UsbHandle¶
Interface for initializing and using the USB Peripherals on the daisy. More...
#include <usb.h>
Public Types¶
Name | |
---|---|
enum class | Result |
enum | UsbPeriph |
enum class | Result |
enum | UsbPeriph |
typedef void(*)(uint8_t *buff, uint32_t *len))(uint8_t *buff, uint32_t *len) | ReceiveCallback |
typedef void(*)(uint8_t *buff, uint32_t *len))(uint8_t *buff, uint32_t *len) | ReceiveCallback |
Public Functions¶
Name | |
---|---|
UsbHandle() | |
~UsbHandle() | |
void | Init(UsbPeriph dev) |
void | DeInit(UsbPeriph dev) |
Result | TransmitInternal(uint8_t * buff, size_t size) |
Result | TransmitExternal(uint8_t * buff, size_t size) |
void | SetReceiveCallback(ReceiveCallback cb, UsbPeriph dev) |
UsbHandle() | |
~UsbHandle() | |
void | Init(UsbPeriph dev) |
void | DeInit(UsbPeriph dev) |
Result | TransmitInternal(uint8_t * buff, size_t size) |
Result | TransmitExternal(uint8_t * buff, size_t size) |
void | SetReceiveCallback(ReceiveCallback cb, UsbPeriph dev) |
Detailed Description¶
Interface for initializing and using the USB Peripherals on the daisy.
Author: Stephen Hensley
Date: December 2019
Public Types Documentation¶
enum Result¶
Enumerator | Value | Description |
---|---|---|
OK | ||
ERR | ||
OK | ||
ERR |
Return values for USBHandle Functions
enum UsbPeriph¶
Enumerator | Value | Description |
---|---|---|
FS_INTERNAL | Internal pin | |
FS_EXTERNAL | FS External D+ pin is Pin 38 (GPIO32). FS External D- pin is Pin 37 (GPIO31) | |
FS_BOTH | Both | |
FS_INTERNAL | Internal pin | |
FS_EXTERNAL | FS External D+ pin is Pin 38 (GPIO32). FS External D- pin is Pin 37 (GPIO31) | |
FS_BOTH | Both |
Specified which of the two USB Peripherals to initialize.
enum Result¶
Enumerator | Value | Description |
---|---|---|
OK | ||
ERR | ||
OK | ||
ERR |
Return values for USBHandle Functions
enum UsbPeriph¶
Enumerator | Value | Description |
---|---|---|
FS_INTERNAL | Internal pin | |
FS_EXTERNAL | FS External D+ pin is Pin 38 (GPIO32). FS External D- pin is Pin 37 (GPIO31) | |
FS_BOTH | Both | |
FS_INTERNAL | Internal pin | |
FS_EXTERNAL | FS External D+ pin is Pin 38 (GPIO32). FS External D- pin is Pin 37 (GPIO31) | |
FS_BOTH | Both |
Specified which of the two USB Peripherals to initialize.
typedef ReceiveCallback¶
Function called upon reception of a buffer
typedef ReceiveCallback¶
Function called upon reception of a buffer
Public Functions Documentation¶
function UsbHandle¶
function ~UsbHandle¶
function Init¶
Parameters:
- dev Device to initialize
Initializes the specified peripheral(s) as USB CDC Devices
function DeInit¶
Parameters:
- dev Device to deinitialize
Deinitializes the specified peripheral(s)
function TransmitInternal¶
Parameters:
- buff Buffer to transmit
- size Buffer size
Transmits a buffer of 'size' bytes from the on board USB FS port.
function TransmitExternal¶
Parameters:
- buff Buffer to transmit
- size Buffer size
Transmits a buffer of 'size' bytes from a USB port connected to the external USB Pins of the daisy seed.
function SetReceiveCallback¶
Parameters:
- cb Function to serve as callback
- dev Device to set callback for
sets the callback to be called upon reception of new data
function UsbHandle¶
function ~UsbHandle¶
function Init¶
Parameters:
- dev Device to initialize
Initializes the specified peripheral(s) as USB CDC Devices
function DeInit¶
Parameters:
- dev Device to deinitialize
Deinitializes the specified peripheral(s)
function TransmitInternal¶
Parameters:
- buff Buffer to transmit
- size Buffer size
Transmits a buffer of 'size' bytes from the on board USB FS port.
function TransmitExternal¶
Parameters:
- buff Buffer to transmit
- size Buffer size
Transmits a buffer of 'size' bytes from a USB port connected to the external USB Pins of the daisy seed.
function SetReceiveCallback¶
Parameters:
- cb Function to serve as callback
- dev Device to set callback for
sets the callback to be called upon reception of new data
---¶
Updated on 2024-01-03 at 19:41:01 +0000