|
PixelKey
NeoPixel USB Key
|
Macros | |
| #define | USB_BUFFER_LENGTH (64) |
| Buffer length for USB operations, must be a multiple of 64. | |
Enumerations | |
| enum | usb_op_state_t { USB_OP_STATE_OFFLINE , USB_OP_STATE_ONLINE , USB_OP_STATE_CONTROL_SEQUENCE , USB_OP_STATE_READ , USB_OP_STATE_WRITE } |
| USB operational state. More... | |
Functions | |
| static bool | rx_start (void) |
| Starts read processing. | |
| static void | rx_end (usb_event_info_t const *const p_event_info) |
| Finishes read processing on USB_STATUS_READ_COMPLETE event. | |
| static bool | tx_start (void) |
| Starts write processing. | |
| static void | tx_end (void) |
| Finishes write processing on USB_STATUS_WRITE_COMPLETE event. | |
| static pixelkey_error_t | usb_serial_read (uint8_t *p_buffer, size_t *p_read_length) |
| Provides a read method for the serial_api_t API. More... | |
| static pixelkey_error_t | usb_serial_write (uint8_t *p_buffer, size_t write_length) |
| Provides a write method for the serial_api_t API. More... | |
| static pixelkey_error_t | usb_serial_flush (void) |
| Provides a flush method for the serial_api_t API. More... | |
| static bool | usb_serial_rts (void) |
| Gets the RTS signal state. | |
| static uint8_t rx_buffer[(64)] | __attribute__ ((aligned(2))) |
| RX data buffer. More... | |
| void | hal_usb_idle (void) |
| Idle function to check the status of the USB comms and handle CDC specific messaging. | |
Variables | |
| static usb_op_state_t | op_state = USB_OP_STATE_OFFLINE |
| Current operational state of the USB. | |
| static usb_pcdc_linecoding_t | line_coding = {0} |
| The currently configured line coding. More... | |
| static usb_pcdc_ctrllinestate_t | line_state = {0} |
| static size_t | rx_length = 0 |
| Number of bytes received. | |
| static size_t | tx_length = 0 |
| Number of bytes to transmit. | |
| const serial_api_t | g_hal_usb_serial |
| Serial instance for USB. More... | |
| enum usb_op_state_t |
USB operational state.
|
static |
RX data buffer.
TX data buffer.
|
static |
Provides a flush method for the serial_api_t API.
| PIXELKEY_ERROR_COMMUNICATION_ERROR | The USB connection is offline or has yet to be enumerated. |
| PIXELKEY_ERROR_NONE | Write was performed successfully. |
|
static |
Provides a read method for the serial_api_t API.
| [in] | p_buffer | Pointer to the buffer to store read data. |
| [in,out] | p_read_length | Pointer to the maximum read length, updated afterwards with the actual read length. |
| PIXELKEY_ERROR_COMMUNICATION_ERROR | The USB connection is offline or has yet to be enumerated. |
| PIXELKEY_ERROR_NONE | Read was performed successfully. |
|
static |
Provides a write method for the serial_api_t API.
| [in] | p_buffer | Pointer to the buffer of data to write. |
| write_length | Total number of bytes to write. |
| PIXELKEY_ERROR_COMMUNICATION_ERROR | The USB connection is offline or has yet to be enumerated. |
| PIXELKEY_ERROR_BUFFER_FULL | Writing the requested amount of data will overrun the transmit buffer. |
| PIXELKEY_ERROR_NONE | Write was performed successfully. |
| const serial_api_t g_hal_usb_serial |
Serial instance for USB.
|
static |
The currently configured line coding.
Unused for this application but required for USB CDC.