Specifications
V850E2/MN4 USB CDC (Communication Device Class) Driver
R01AN0010EJ0101 Rev.1.01 Page 61 of 117
Feb 01, 2012
(1)
Definitions and Declarations
The two header files usbf850.h and usbf850_communication.h are included so that the sample driver functions can be
used. Also, a user buffer with a size adequate for processing one packet of data is provided for user data (the maximum
packet size for bulk endpoints in USB full speed is 64 bytes).
(2)
CPU Initialization
The CPU initialization function (cpu_init()) is called.
(3)
USB Function Controller Initialization
The USB function controller initialization function (usbf850_init()) is called.
(4)
User Data FIFO State Verification
The FIFO state is verified by calling the user data FIFO state reporting function (usbf850_get_bufinit_flg()).
(5)
User Data Reception Processing
The CDC user data reception processing function (usbf850_recv_buf()) is called and the result saved.
(6)
User Data Transmission Processing
The CDC user data transmission processing function (usbf850_send_buf()) is called and the result saved.
(7)
Clearing the Transmit/Receive Results
The transmit and receive results saved in (5) and (6) are cleared to zero when the user data FIFO is initialized.
(8)
Suspend and Resume Processing
The flag (usbf850_rsuspd_flg) that indicates that a suspend has occurred is monitored. If a suspend has occurred, the
__halt() function is called to transition to the HALT state. A resume is performed in response to an external interrupt,
and the flag (usbf850_rsuspd_flg) that indicates that a suspend has occurred is set to the RESUME state and operation
restarts.