Instruction manual

Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 123 of 157
Apr 1, 2013
5.10 Host Sample Program
USB-BASIC-FW host sample program is configured with a vendor class driver and sample application. It includes the
following features.
1. Data transfer with USB-BASIC-FW peripheral sample program (see 5.10 Host Sample Program)
2. ANSI-type API
Host–peripheral data communication sample program
The host sample program can communicate with a peripheral device also running the USB-BASIC-F/W sample code.
Bulk and interrupt data can be transferred.
5.10.1 Operation
The following describes an example of the host sample program for non-OS operations.
1. Initialization
When the device goes to the reset state, the PowerON_Reset_PC function in resetprg.c is called.
The PowerON_Reset_PC function initializes the MCU, sections, the scheduler, etc., and then calls the
usb_cstd_main_task function in main.c. After the USB module is set and tasks are registered in the usb_cstd_main_task
function, the device returns to the static state.
Figure 5-1 shows the general flow of the initialization routine from reset state to static state.
Reset
PowerON_Reset_PC
usb_cstd_main_task
PowerON_Reset_PC
MCU initial setting
Scheduler initialization
End
usb_cstd_main_task
usb_cstd_task_start
MCU initial setting
USB module interrupt initial
setting
DMA module interrupt initial
setting
Evaluation board
circumference function
settings
End
End
usb_cstd_task_start
HDCD registration
USB module start
USB module operational
mode setup
HCD is registered into a
scheduler
HDCD is registered into a
scheduler
APL is registered into a
scheduler
usb_apl_task_switch
Stationary state
End
Figure 5-1 Host Sample Program Intialization Overview