
USB Basic Firmware <Short Sheet>
R01AN0495EJ0100 Rev.1.00 Page 17 of 32
Apr 15, 2011
3.2.5 Example of Creating a Peripheral Application
The following is an example of embedding a USB-BASIC-F/W data transfer sample application. For more details, refer to
r_usb_PSMPL_apl.c.
(1) Example of creating a main task
Figure. 3.3 Example of coding a Peripheral Application (1)
“r_usb_PSMPL_apl.c”
void usbc_cstd_MainTask(USBC_VP_INT stacd)
{
/* Sample application initial process */
usb_pstd_MainInit(); Å USB function
Initialization(Start the PCD, Register the PDCD)
Refer to 3.2.5(2)
/* Idle Task Start process */
usbc_cstd_IdleTaskStart();
/* Sample application main loop process */
while( 1 )
{
usb_pstd_MainLoop(); Å Mainloop (Applicaton) Refer to 3.2.5(3)
/* Condition compilation by the difference of the operating system */
#if USBC_FW_PP == USBC_FW_NONOS_PP
/* Idle Task (sleep sample) */
usbc_cstd_IdleTask(0);
#endif /* USBC_FW_PP == USBC_FW_NONOS_PP */
}
}
Comentarios a estos manuales