Instructions
Device Reset
Initialize I /Os, clocks, and power
Initialize USB-related functions
Trigger the MSC interface to poll
for new SCSI commands from the
host, using USBMSC_poll()
Enter LPM0
Call mscProcessBuffer () to
process any pending READ or
WRITE operations
Has button S 1 been
pressed?
Has button S 2 been
pressed?
Is
bUsbSendCompleted
TRUE, and is
charLeftToSend
non-zero?
Is next key
direction down or
up?
Send USB report containing the
previous character, as an up-press,
using USBHID_sendReport (). Set
bUsbSendCompleted to FALSE
USB interrupt results in a
USBHID_handleSendCompleted () event,
indicating the HID report has now been sent
bUsbSendCompleted flag is set to TRUE
Initiate string output , using prepSendingStr (). Set
charLeftToSend to the length of the string .
Initiate string output , using prepSendingStr (). Set
charLeftToSend to the length of the string .
Send USB report containing the
next character, as a down -press,
using USBHID_sendReport ().
Set bUsbSendCompleted to FALSE
Main while(1) loop
USB event handlers
From within the USB API
USB interrupt results in new
MSC SCSI command received
Wake from LPM
The handler returns TRUE, waking the
device from LPM0 (if it was sleeping)
Port I/O ISR
Pushbutton is pressed
Was a READ or WRITE SCSI
command received?
No
Yes
No
No
Yes
Yes
No
Yes Down
Up
charLeftToSend=0?
Yes
No
Any button presses?
No
Yes
Pre-initialization : disable
watchdog
bButton1Pressed or
bButton1Pressed
flag is set to TRUE
User Experience Software
www.ti.com
3.5 Out-of-Box Experience: emulStorageKeyboard
This is the demo that is loaded into the F5529 LaunchPad at the factory. It is described in Section 1.3.
This demo is slightly more advanced than the simpleUsbBackchannel demo.
The code is prolifically commented, and the following sections provide additional detail.
3.5.1 Flowchart
Figure 28 shows the program flow. The following sections reference this flow.
Figure 28. Demo Program Flow
34
MSP430F5529 LaunchPad™ Development Tool (MSP
‑
EXP430F5529LP) SLAU533A–September 2013–Revised January 2014
Submit Documentation Feedback
Copyright © 2013–2014, Texas Instruments Incorporated