Skip to content

Class UsbHandle

ClassList > UsbHandle

Interface for initializing and using the USB Peripherals on the daisy. More...

  • #include <usb.h>

Public Types

Type Name
typedef void(* ReceiveCallback
typedef void(* ReceiveCallback
enum Result
enum Result
enum UsbPeriph
enum UsbPeriph

Public Functions

Type Name
void DeInit (UsbPeriph dev)
void DeInit (UsbPeriph dev)
void Init (UsbPeriph dev)
void Init (UsbPeriph dev)
void SetReceiveCallback (ReceiveCallback cb, UsbPeriph dev)
void SetReceiveCallback (ReceiveCallback cb, UsbPeriph dev)
Result TransmitExternal (uint8_t * buff, size_t size)
Result TransmitExternal (uint8_t * buff, size_t size)
Result TransmitInternal (uint8_t * buff, size_t size)
Result TransmitInternal (uint8_t * buff, size_t size)
UsbHandle ()
UsbHandle ()
~UsbHandle ()
~UsbHandle ()

Detailed Description

Author:

Stephen Hensley

Date:

December 2019

Public Types Documentation

typedef ReceiveCallback [½]

typedef void(* UsbHandle::ReceiveCallback) (uint8_t *buff, uint32_t *len);

Function called upon reception of a buffer


typedef ReceiveCallback [½]

typedef void(* UsbHandle::ReceiveCallback) (uint8_t *buff, uint32_t *len);

Function called upon reception of a buffer


enum Result [½]

enum UsbHandle::Result {
    OK,
    ERR,
    OK,
    ERR
};

Return values for USBHandle Functions


enum Result [½]

enum UsbHandle::Result {
    OK,
    ERR,
    OK,
    ERR
};

Return values for USBHandle Functions


enum UsbPeriph [½]

enum UsbHandle::UsbPeriph {
    FS_INTERNAL,
    FS_EXTERNAL,
    FS_BOTH,
    FS_INTERNAL,
    FS_EXTERNAL,
    FS_BOTH
};

Specified which of the two USB Peripherals to initialize.


enum UsbPeriph [½]

enum UsbHandle::UsbPeriph {
    FS_INTERNAL,
    FS_EXTERNAL,
    FS_BOTH,
    FS_INTERNAL,
    FS_EXTERNAL,
    FS_BOTH
};

Specified which of the two USB Peripherals to initialize.


Public Functions Documentation

function DeInit [½]

void UsbHandle::DeInit (
    UsbPeriph dev
) 

Deinitializes the specified peripheral(s)

Parameters:

  • dev Device to deinitialize

function DeInit [½]

void UsbHandle::DeInit (
    UsbPeriph dev
) 

Deinitializes the specified peripheral(s)

Parameters:

  • dev Device to deinitialize

function Init [½]

void UsbHandle::Init (
    UsbPeriph dev
) 

Initializes the specified peripheral(s) as USB CDC Devices

Parameters:

  • dev Device to initialize

function Init [½]

void UsbHandle::Init (
    UsbPeriph dev
) 

Initializes the specified peripheral(s) as USB CDC Devices

Parameters:

  • dev Device to initialize

function SetReceiveCallback [½]

void UsbHandle::SetReceiveCallback (
    ReceiveCallback cb,
    UsbPeriph dev
) 

sets the callback to be called upon reception of new data

Parameters:

  • cb Function to serve as callback
  • dev Device to set callback for

function SetReceiveCallback [½]

void UsbHandle::SetReceiveCallback (
    ReceiveCallback cb,
    UsbPeriph dev
) 

sets the callback to be called upon reception of new data

Parameters:

  • cb Function to serve as callback
  • dev Device to set callback for

function TransmitExternal [½]

Result UsbHandle::TransmitExternal (
    uint8_t * buff,
    size_t size
) 

Transmits a buffer of 'size' bytes from a USB port connected to the external USB Pins of the daisy seed.

Parameters:

  • buff Buffer to transmit
  • size Buffer size

function TransmitExternal [½]

Result UsbHandle::TransmitExternal (
    uint8_t * buff,
    size_t size
) 

Transmits a buffer of 'size' bytes from a USB port connected to the external USB Pins of the daisy seed.

Parameters:

  • buff Buffer to transmit
  • size Buffer size

function TransmitInternal [½]

Result UsbHandle::TransmitInternal (
    uint8_t * buff,
    size_t size
) 

Transmits a buffer of 'size' bytes from the on board USB FS port.

Parameters:

  • buff Buffer to transmit
  • size Buffer size

function TransmitInternal [½]

Result UsbHandle::TransmitInternal (
    uint8_t * buff,
    size_t size
) 

Transmits a buffer of 'size' bytes from the on board USB FS port.

Parameters:

  • buff Buffer to transmit
  • size Buffer size

function UsbHandle [½]

inline UsbHandle::UsbHandle () 

function UsbHandle [½]

inline UsbHandle::UsbHandle () 

function ~UsbHandle [½]

inline UsbHandle::~UsbHandle () 

function ~UsbHandle [½]

inline UsbHandle::~UsbHandle () 


The documentation for this class was generated from the following file external-docs/libDaisy/src/hid/usb.h