USBLibAPIGuide
1.00.00.01
|
Data Structures | |
struct | tDFUInstance |
struct | tUSBDDFUDevice |
Macros | |
#define | NUM_DFU_SECTIONS |
#define | DFUINTERFACE_SIZE (9) |
#define | DFUFUNCTIONALDESC_SIZE (9) |
#define | COMPOSITE_DDFU_SIZE (DFUINTERFACE_SIZE + DFUFUNCTIONALDESC_SIZE) |
#define | USBD_DFU_EVENT_DETACH (USBD_DFU_EVENT_BASE + 0) |
Functions | |
void * | USBDDFUCompositeInit (uint32_t ui32Index, tUSBDDFUDevice *psDFUDevice, tCompositeEntry *psCompEntry) |
void | USBDDFUCompositeTerm (void *pvDFUInstance) |
void | USBDDFUUpdateBegin (void) |
Variables | |
const uint8_t | g_pui8DFUDeviceDescriptor [] |
uint8_t | g_pui8DFUConfigDescriptor [] |
uint8_t | g_pui8DFUInterface [DFUINTERFACE_SIZE] |
uint8_t | g_pui8DFUFunctionalDesc [DFUFUNCTIONALDESC_SIZE] |
const tConfigSection | g_sDFUConfigSection |
const tConfigSection | g_sDFUInterfaceSection |
const tConfigSection | g_sDFUFunctionalDescSection |
const tConfigSection * | g_psDFUSections [] |
tConfigHeader | g_sDFUConfigHeader |
const tConfigHeader *const | g_ppsDFUConfigDescriptors [] |
#define NUM_DFU_SECTIONS |
#define DFUINTERFACE_SIZE (9) |
#define DFUFUNCTIONALDESC_SIZE (9) |
#define COMPOSITE_DDFU_SIZE (DFUINTERFACE_SIZE + DFUFUNCTIONALDESC_SIZE) |
The size of the memory that should be allocated to create a configuration descriptor for a single instance of the DFU runtime device. This does not include the configuration descriptor which is automatically ignored by the composite device class.
This label is used to compute the value which will be passed to the USBDCompositeInit function in the ui32Size parameter.
#define USBD_DFU_EVENT_DETACH (USBD_DFU_EVENT_BASE + 0) |
This value is passed to the client via the callback function provided in the tUSBDDFUDevice structure and indicates that the host has sent a DETACH request to the DFU interface. This request indicates that the device detach from the USB bus and reattach in DFU mode in preparation for a firmware upgrade. Currently, this is the only event that the DFU runtime class reports to the client.
When this event is received, the client should call USBDDFUUpdateBegin() from a non-interrupt context at its earliest opportunity.
void * USBDDFUCompositeInit | ( | uint32_t | ui32Index, |
tUSBDDFUDevice * | psDFUDevice, | ||
tCompositeEntry * | psCompEntry | ||
) |
Initializes DFU device operation for a given USB controller.
ui32Index | is the index of the USB controller which is to be initialized for DFU runtime device operation. |
psDFUDevice | points to a structure containing parameters customizing the operation of the DFU device. |
psCompEntry | is the composite device entry to initialize when creating a composite device. |
The psCompEntry should point to the composite device entry to initialize. This is part of the array that is passed to the USBDCompositeInit() function.
References tDeviceInfo::psCallbacks, tCompositeEntry::psDevInfo, tCompositeEntry::pvInstance, tDFUInstance::sDevInfo, and tUSBDDFUDevice::sPrivateData.
void USBDDFUCompositeTerm | ( | void * | pvDFUInstance | ) |
Shuts down the DFU device.
pvDFUInstance | is the pointer to the device instance structure as returned by USBDDFUCompositeInit(). |
This function terminates DFU operation for the instance supplied and removes the device from the USB bus.
Following this call, the pvDFUInstance instance should not me used in any other calls.
References tDFUInstance::ui32USBBase, and USBDCDTerm().
void USBDDFUUpdateBegin | ( | void | ) |
Removes the current USB device from the bus and transfers control to the DFU boot loader.
This function should be called from the application's main loop (i.e. not in interrupt context) following a callback to the USB DFU callback function notifying the application of a DETACH request from the host. The function will prepare the system to switch to DFU mode and transfer control to the boot loader in preparation for a firmware upgrade from the host.
The application must ensure that it has completed all necessary shutdown activities (saved any required data, etc.) before making this call since the function will not return.
References USBDCDTerm().
const uint8_t g_pui8DFUDeviceDescriptor[] |
uint8_t g_pui8DFUConfigDescriptor[] |
uint8_t g_pui8DFUInterface[DFUINTERFACE_SIZE] |
uint8_t g_pui8DFUFunctionalDesc[DFUFUNCTIONALDESC_SIZE] |
const tConfigSection g_sDFUConfigSection |
const tConfigSection g_sDFUInterfaceSection |
const tConfigSection g_sDFUFunctionalDescSection |
const tConfigSection* g_psDFUSections[] |
tConfigHeader g_sDFUConfigHeader |
const tConfigHeader* const g_ppsDFUConfigDescriptors[] |