|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
#include "mod_gpg/openpgp/ccid.h"#include "mod_gpg/openpgp/openpgp.h"#include "cdc_log.h"#include "tusb.h"#include "device/usbd_pvt.h"#include <esp_attr.h>#include <string.h>#include <stdio.h>Go to the source code of this file.
Macros | |
| #define | CCID_LOG(tag, fmt, ...) |
| #define | CCID_LOG_E(tag, fmt, ...) |
| #define | CCID_LOG_W(tag, fmt, ...) |
| #define | CCID_RX_BUF_SIZE (CCID_MAX_MSG_SIZE + CCID_HEADER_SIZE) |
| #define | CCID_TX_BUF_SIZE (CCID_MAX_MSG_SIZE + CCID_HEADER_SIZE) |
Functions | |
| static void | ccid_driver_init (void) |
| static void | ccid_driver_reset (uint8_t rhport) |
| static uint16_t | ccid_driver_open (uint8_t rhport, tusb_desc_interface_t const *desc_itf, uint16_t max_len) |
| static bool | ccid_driver_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const *request) |
| static bool | ccid_driver_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes) |
| void | ccid_driver_link_anchor (void) |
| Initializes CCID transport and backing OpenPGP applet. | |
| usbd_class_driver_t const * | usbd_app_driver_get_cb (uint8_t *driver_count) |
Variables | |
| static const char * | TAG = "CCID" |
| static uint8_t | ccid_rx_buf [(2048+10)] |
| static uint8_t | ccid_tx_buf [(2048+10)] |
| struct { | |
| bool initialized | |
| uint8_t itf_num | |
| uint8_t ep_in | |
| uint8_t ep_out | |
| uint8_t rhport | |
| uint16_t rx_len | |
| bool rx_pending | |
| uint32_t rx_count | |
| uint32_t tx_count | |
| uint32_t error_count | |
| } | ccid_state |
| static usbd_class_driver_t const | ccid_driver |
| #define CCID_LOG | ( | tag, | |
| fmt, | |||
| ... ) |
Definition at line 16 of file ccid_driver.cpp.
Referenced by ccid_driver_init().
| #define CCID_LOG_E | ( | tag, | |
| fmt, | |||
| ... ) |
Definition at line 17 of file ccid_driver.cpp.
| #define CCID_LOG_W | ( | tag, | |
| fmt, | |||
| ... ) |
Definition at line 18 of file ccid_driver.cpp.
| #define CCID_RX_BUF_SIZE (CCID_MAX_MSG_SIZE + CCID_HEADER_SIZE) |
Definition at line 20 of file ccid_driver.cpp.
| #define CCID_TX_BUF_SIZE (CCID_MAX_MSG_SIZE + CCID_HEADER_SIZE) |
Definition at line 21 of file ccid_driver.cpp.
|
static |
Definition at line 110 of file ccid_driver.cpp.
References ccid_state, and rhport.
|
static |
Definition at line 42 of file ccid_driver.cpp.
References CCID_LOG, ccid_state, and TAG.
| void ccid_driver_link_anchor | ( | void | ) |
Initializes CCID transport and backing OpenPGP applet.
Definition at line 226 of file ccid_driver.cpp.
Referenced by ccid_init().
|
static |
Definition at line 57 of file ccid_driver.cpp.
References ccid_rx_buf, ccid_state, and rhport.
|
static |
Definition at line 47 of file ccid_driver.cpp.
References ccid_state, and rhport.
|
static |
Definition at line 154 of file ccid_driver.cpp.
References CCID_HEADER_SIZE, ccid_process_message(), ccid_rx_buf, ccid_state, ccid_tx_buf, and rhport.
| usbd_class_driver_t const * usbd_app_driver_get_cb | ( | uint8_t * | driver_count | ) |
Definition at line 228 of file ccid_driver.cpp.
References ccid_driver.
|
static |
Definition at line 209 of file ccid_driver.cpp.
Referenced by usbd_app_driver_get_cb().
|
static |
Definition at line 24 of file ccid_driver.cpp.
Referenced by ccid_driver_open(), and ccid_driver_xfer_cb().
| struct { ... } ccid_state |
Referenced by ccid_driver_control_xfer_cb(), ccid_driver_init(), ccid_driver_open(), ccid_driver_reset(), and ccid_driver_xfer_cb().
|
static |
Definition at line 25 of file ccid_driver.cpp.
Referenced by ccid_driver_xfer_cb().
| uint8_t ep_in |
Definition at line 30 of file ccid_driver.cpp.
| uint8_t ep_out |
Definition at line 31 of file ccid_driver.cpp.
| uint32_t error_count |
Definition at line 39 of file ccid_driver.cpp.
| bool initialized |
Definition at line 28 of file ccid_driver.cpp.
| uint8_t itf_num |
Definition at line 29 of file ccid_driver.cpp.
| uint8_t rhport |
Definition at line 32 of file ccid_driver.cpp.
Referenced by ccid_driver_control_xfer_cb(), ccid_driver_open(), ccid_driver_reset(), and ccid_driver_xfer_cb().
| uint32_t rx_count |
Definition at line 37 of file ccid_driver.cpp.
| uint16_t rx_len |
Definition at line 34 of file ccid_driver.cpp.
| bool rx_pending |
Definition at line 35 of file ccid_driver.cpp.
|
static |
Definition at line 14 of file ccid_driver.cpp.
| uint32_t tx_count |
Definition at line 38 of file ccid_driver.cpp.