38
EZ-USB Development Kit User Guide, Doc. # 001-66390 Rev. *D
EZ-USB Firmware Frameworks
5.3
Function Hooks
The frameworks provides function hooks to simplify the addition of user code. The functions are
divided into three categories: those called by the task dispatcher, the standard device request
parser, and the USB interrupt handler. The following sections contain a complete list of functions and
their descriptions.
5.3.1
Task Dispatcher Functions
The following functions are called by the task dispatcher located in main().
5.3.1.1
TD_Init()
void TD_Init()
This function is called once during the initialization of the frameworks. It is called before ReNumera-
tion and the Task Dispatcher starts. It is intended for the global state variable and device initializa-
tion.
5.3.1.2
TD_Poll()
void TD_Poll()
This function is called repeatedly during device operation. It should contain a state machine that
implements the user's peripheral function. High-priority tasks can be completed before returning
from this function. However, failure to return from this function prevents frameworks from responding
to device requests and USB suspend events. If a large amount of processing time is required, it must
be split up to execute in multiple calls to TD_Poll().
5.3.1.3
TD_Suspend()
BOOL TD_Suspend()
This function is called before the frameworks enter suspend mode. This function contains code that
places the device in a low-power state and returns TRUE. However, the user code can prevent the
frameworks from entering suspend mode by returning FALSE.
5.3.1.4
TD_Resume()
void TD_Resume()
This function is called after the frameworks has resumed the processor in response to an external
resume event. At this point, the device resumes full-power operation.
5.3.2
Device Request Functions
These are helper functions that the device request handler (SetupCommand() in FW.C) calls. These
are mainly used to override or augment the default device request handler.
5.3.2.1
DR_GetDescriptor()
BOOL DR_GetDescriptor()
This function is called before the frameworks decode and implement the GetDescriptor device
request. The register array SETUPDAT contains the current eight byte setup command. It can be
parsed by the user's code to determine which Get Descriptor command is issued. If TRUE is
returned, the frameworks will parse and implement the command. If FALSE is returned, it will do
nothing.
Summary of Contents for CY3674
Page 18: ...18 EZ USB Development Kit User Guide Doc 001 66390 Rev D Getting Started...
Page 34: ...34 EZ USB Development Kit User Guide Doc 001 66390 Rev D Development Kit Contents...
Page 54: ...54 EZ USB Development Kit User Guide Doc 001 66390 Rev D Cypress USB Drivers for EZ USB Kits...
Page 110: ...110 EZ USB Development Kit User Guide Doc 001 66390 Rev D Resources...
Page 113: ...EZ USB Development Kit User Guide Doc 001 66390 Rev D 113 A 2 Board Layout...