Difference between revisions of "Component: USB Slave (Comms: USB)"
From Flowcode Help
Jump to navigationJump to search| Line 48: | Line 48: | ||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
| + | |||
| + | |||
| Line 53: | Line 55: | ||
==Macro reference== | ==Macro reference== | ||
| + | ===SendString=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 76: | Line 79: | ||
| + | ===GetString=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 94: | Line 98: | ||
| + | ===RunSlaveService=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 107: | Line 112: | ||
| + | ===SendByte=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 125: | Line 131: | ||
| + | ===SendByteArray=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 148: | Line 155: | ||
| + | ===CheckRx=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 161: | Line 169: | ||
| + | ===GetByte=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 179: | Line 188: | ||
| + | ===StopSlaveService=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 192: | Line 202: | ||
| + | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Revision as of 11:52, 3 February 2023
| Author | Matrix Ltd. |
| Version | 1.3 |
| Category | Comms: USB |
Contents
USB Slave component
Component to create and communicate using a generic USB communications profile. Has the ability to allow the device to be a slave to the PC. Compatible with simulation and USB enabled microcontroller devices (PIC/dsPIC).
Component Source Code
Please click here to download the component source project: FC_Comp_Source_USBSlave.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_USBSlave.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
SendString
| SendString | |
| Adds a string of bytes onto the end of the outgoing data buffer. | |
| Data | |
| Data String To Send | |
| Length | |
| Max number of bytes to try and add to the outgoing buffer. | |
| Return | |
GetString
RunSlaveService
SendByte
| SendByte | |
| Adds the byte onto the end of the outgoing data buffer. | |
| Data | |
| Data byte to transmit to the host | |
| Return | |
SendByteArray
CheckRx
| CheckRx | |
| Called to check if there is any incoming data waiting to be received. Returns the number of incoming data bytes. Only needed when not running the slave service. | |
| Return | |
GetByte
| GetByte | |
| Retreives the byte at location Idx from the incoming data buffer. | |
| Idx | |
| Specifies the location in the incoming buffer | |
| Return | |
StopSlaveService
Initialise
| Initialise | |
| Starts up the USB communications and attempts to enumerate. Returns 0 for a successful startup or 255 for a enumeration timeout. | |
| Return | |