Component: USB Slave (Comms: USB): Difference between revisions
Appearance
m Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable"" |
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;" align="center"" to "width="10%" align="center" class="mtx-class-macrohead"" |
||
| Line 64: | Line 64: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckRx''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckRx''' | ||
|- | |- | ||
| Line 78: | Line 78: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetByte''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetByte''' | ||
|- | |- | ||
| Line 97: | Line 97: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetString''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetString''' | ||
|- | |- | ||
| Line 116: | Line 116: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | ||
|- | |- | ||
| Line 130: | Line 130: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RunSlaveService''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RunSlaveService''' | ||
|- | |- | ||
| Line 144: | Line 144: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendByte''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendByte''' | ||
|- | |- | ||
| Line 163: | Line 163: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendByteArray''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendByteArray''' | ||
|- | |- | ||
| Line 187: | Line 187: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendString''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendString''' | ||
|- | |- | ||
| Line 211: | Line 211: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''StopSlaveService''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''StopSlaveService''' | ||
|- | |- | ||
Revision as of 14:17, 13 July 2026
| Author | Matrix Ltd. |
| Version | 1.3 |
| Category | Comms: USB |
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
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 | |
GetString
Initialise
| Initialise | |
| Starts up the USB communications and attempts to enumerate. Returns 0 for a successful startup or 255 for a enumeration timeout. | |
| Return | |
RunSlaveService
SendByte
| SendByte | |
| Adds the byte onto the end of the outgoing data buffer. | |
| Data | |
| Data byte to transmit to the host | |
| Return | |
SendByteArray
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 | |
StopSlaveService