Difference between revisions of "Component: API (ESP32) (API Slave Devices)"

From Flowcode Help
Jump to navigationJump to search
 
(8 intermediate revisions by 2 users not shown)
Line 16: Line 16:
  
 
==Component Source Code==
 
==Component Source Code==
 +
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_ESP32_API_Comp.fcfx FC_Comp_Source_ESP32_API_Comp.fcfx]
  
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ESP32_API_Comp.fcfx FC_Comp_Source_ESP32_API_Comp.fcfx]
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ESP32_API_Comp.fcfx FC_Comp_Source_ESP32_API_Comp.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
 +
 +
 +
 +
  
  
Line 63: Line 71:
  
 
==Examples==
 
==Examples==
 +
 +
 +
 +
 +
 +
  
  
Line 96: Line 110:
 
|4
 
|4
 
|5
 
|5
|6
 
|7
 
|8
 
|9
 
|10
 
|11
 
 
|12
 
|12
 
|13
 
|13
Line 130: Line 138:
 
|A4
 
|A4
 
|A5
 
|A5
|A6
 
|A7
 
|A8
 
|A9
 
|A10
 
|A11
 
 
|A12
 
|A12
 
|A13
 
|A13
Line 164: Line 166:
 
|4
 
|4
 
|5
 
|5
|6
 
|7
 
|8
 
|9
 
|10
 
|11
 
 
|12
 
|12
 
|13
 
|13
Line 227: Line 223:
  
 
<span style="color:red">Please note that PWM channels are tied in pairs and so channel 0 and 1 use the same internal timer peripheral. They will always run at the same frequency and when enabling channel 1 channel 0 duty will be reset to 0% and visa versa.</span>
 
<span style="color:red">Please note that PWM channels are tied in pairs and so channel 0 and 1 use the same internal timer peripheral. They will always run at the same frequency and when enabling channel 1 channel 0 duty will be reset to 0% and visa versa.</span>
 +
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 263: Line 260:
 
|A15
 
|A15
 
|A14
 
|A14
|A9
+
|A13
|A10
+
|A12
|A11
+
|A14
|A6
+
|A23
|A7
+
|A19
|A8
+
|A18
 
|A26
 
|A26
 
|A25
 
|A25
Line 292: Line 289:
 
|15
 
|15
 
|14
 
|14
|9
+
|13
|10
+
|12
|11
+
|14
|6
+
|23
|7
+
|19
|8
+
|18
 
|26
 
|26
 
|25
 
|25
Line 324: Line 321:
 
==Macro reference==
 
==Macro reference==
  
 +
===ADCSample10===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CInitialise'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSample10'''
 
|-
 
|-
| colspan="2" | Initialise the I2C module ready for communications&nbsp;
+
| colspan="2" | Reads the voltage present on an Analog pin as an 12-bit value range 0-4095&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
+
| width="90%" | ADCChannel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
+
| colspan="2" | Range: 0, 3-7&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Baud
 
|-
 
| colspan="2" | 0=100KHz, 1=400KHz, 2=1MHz&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===ADCSample8===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleArray8'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSample8'''
 
|-
 
|-
| colspan="2" | Reads the voltage present on an Analog pin as an 8-bit value range 0-255 Performs the selected number of samples with the selected time in microseconds in between samples and returns each sample in a single packet&nbsp;
+
| colspan="2" | Reads the voltage present on an Analog pin as an 8-bit value range 0-255&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 360: Line 354:
 
| colspan="2" | Range: 0, 3-7&nbsp;
 
| colspan="2" | Range: 0, 3-7&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | SampleCount
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
 +
 
 +
===ADCSampleArray10===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleArray10'''
 +
|-
 +
| colspan="2" | Reads the voltage present on an Analog pin as an 10-bit value range 0-1023 Performs the selected number of samples with the selected time in microseconds in between samples and returns each sample in a single packet&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ADCChannel
 +
|-
 +
| colspan="2" | Range: 0, 3-7&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | SampleCount
 
|-
 
|-
 
| colspan="2" | Range: 1- 32&nbsp;
 
| colspan="2" | Range: 1- 32&nbsp;
Line 370: Line 383:
 
| colspan="2" | Delay in us between each sample&nbsp;
 
| colspan="2" | Delay in us between each sample&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Samples
 
| width="90%" | Samples
 
|-
 
|-
| colspan="2" | 8-bit samples returned from the function&nbsp;
+
| colspan="2" | 10-bit samples returned from the function&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 380: Line 393:
  
  
 +
===ADCSampleArray8===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPITransferTrans'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleArray8'''
 
|-
 
|-
| colspan="2" | Transfer an array of bytes using the SPI bus&nbsp;
+
| colspan="2" | Reads the voltage present on an Analog pin as an 8-bit value range 0-255 Performs the selected number of samples with the selected time in microseconds in between samples and returns each sample in a single packet&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
+
| width="90%" | ADCChannel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&nbsp;
+
| colspan="2" | Range: 0, 3-7&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Count
+
| width="90%" | SampleCount
 
|-
 
|-
| colspan="2" | Number of bytes to send and receive&nbsp;
+
| colspan="2" | Range: 1- 32&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | DataOut
+
| width="90%" | SampleDelay
 
|-
 
|-
| colspan="2" | Outgoing data&nbsp;
+
| colspan="2" | Delay in us between each sample&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | DataIn
+
| width="90%" | Samples
 
|-
 
|-
| colspan="2" | Incoming data&nbsp;
+
| colspan="2" | 8-bit samples returned from the function&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 413: Line 427:
  
  
 +
===ADCSampleAverage10===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireBusReset'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleAverage10'''
 
|-
 
|-
| colspan="2" | Issue a 'ping' on the bus. If there is at least one sensor on the bus then it will generate a presence pulse.  Returns 0 if a presense pulse was detected Returns 1 no device was detected&nbsp;
+
| colspan="2" | Reads the voltage present on an Analog pin as an 10-bit value range 0-1023. Performs the selected number of samples with the selected time in microseconds in between samples&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
+
| width="90%" | ADCChannel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
+
| colspan="2" | Range: 0, 3-7&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
+
| width="90%" | SampleCount
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IOGetInputPin'''
 
|-
 
| colspan="2" | Sets the selected digital pin to an input and reads the input state.&nbsp;
 
 
|-
 
|-
 +
| colspan="2" | Range: 1- 100&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Pin
+
| width="90%" | SampleDelay
 
|-
 
|-
| colspan="2" | Range: 0-29&nbsp;
+
| colspan="2" | Delay in us between each sample&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===ADCSampleAverage8===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTBaud'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleAverage8'''
 
|-
 
|-
| colspan="2" | Control the communications rate of the UART module&nbsp;
+
| colspan="2" | Reads the voltage present on an Analog pin as an 8-bit value range 0-255 Performs the selected number of samples with the selected time in microseconds in between samples&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
+
| width="90%" | ADCChannel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
+
| colspan="2" | Range: 0, 3-7&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Rate
+
| width="90%" | SampleCount
 
|-
 
|-
| colspan="2" | 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200&nbsp;
+
| colspan="2" | Range: 1- 100&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | SampleDelay
 +
|-
 +
| colspan="2" | Delay in us between each sample&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===ADCSetPrechargeTime===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireInitialise'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSetPrechargeTime'''
 
|-
 
|-
| colspan="2" | Initialise the OneWire module ready for communications&nbsp;
+
| colspan="2" | Specifies the precharge time for the ADC input readings in microseconds. The longer the time the more immune to noise the reading will be.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
+
| width="90%" | ChargeTime
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
+
| colspan="2" | Default 10&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 490: Line 504:
  
  
 +
===ADCSetReferenceVoltage===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireMatchROM'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSetReferenceVoltage'''
 
|-
 
|-
| colspan="2" | Performs a reset followed by the MatchROM code and then the 8-bit ROM code.&nbsp;
+
| colspan="2" | Specified the reference setting for ADC reads.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
+
| width="90%" | RefType
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
+
| colspan="2" | 0=AREF, 1=VCC, 3=Internal 1.1V&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" | FamilyCode
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | SerialNumber
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
 
|}
 
|}
  
  
 +
===I2CInitialise===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSample8'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CInitialise'''
 +
|-
 +
| colspan="2" | Initialise the I2C module ready for communications&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Reads the voltage present on an Analog pin as an 8-bit value range 0-255&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 
|-
 
|-
 +
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ADCChannel
+
| width="90%" | Baud
 
|-
 
|-
| colspan="2" | Range: 0, 3-7&nbsp;
+
| colspan="2" | 0=100KHz, 1=400KHz, 2=1MHz&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===I2CReceive===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CTransReceive'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CReceive'''
 
|-
 
|-
| colspan="2" | Receives an I2C Transaction on the selected I2C channel. Returns the number of bytes received.&nbsp;
+
| colspan="2" | Receive a byte using the I2C bus&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 549: Line 561:
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Data
+
| width="90%" | Last
 
|-
 
|-
| colspan="2" | Data variable to receive into&nbsp;
+
| colspan="2" | Last byte to receive: Range 0-1&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Count
 
|-
 
| colspan="2" | Number of bytes to receive&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===I2CRestart===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTInitialise'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CRestart'''
 
|-
 
|-
| colspan="2" | Initialise the UART module ready for communications&nbsp;
+
| colspan="2" | Put the I2C Module into Restart mode&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 575: Line 583:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
+
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 582: Line 590:
  
  
 +
===I2CSend===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTCheckRX'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CSend'''
 
|-
 
|-
| colspan="2" | Check to see if the UART module has received any data&nbsp;
+
| colspan="2" | Transmit a byte using the I2C bus&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 593: Line 602:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
+
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | DataOut
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===I2CStart===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSetPrechargeTime'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CStart'''
 
|-
 
|-
| colspan="2" | Specifies the precharge time for the ADC input readings in microseconds. The longer the time the more immune to noise the reading will be.&nbsp;
+
| colspan="2" | Put the I2C Module into Start mode&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ChargeTime
+
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Default 10&nbsp;
+
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 618: Line 633:
  
  
 +
===I2CStop===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireTransmitByte'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CStop'''
 
|-
 
|-
| colspan="2" | Transmit a byte to the one wire bus a bit at a time&nbsp;
+
| colspan="2" | Put the I2C Module into Stop mode&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
| width="90%" | Channel
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
 
|-
 
|-
 
| colspan="2" | &nbsp;
 
| colspan="2" | &nbsp;
Line 641: Line 652:
  
  
 +
===I2CTransInit===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CRestart'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CTransInit'''
 
|-
 
|-
| colspan="2" | Put the I2C Module into Restart mode&nbsp;
+
| colspan="2" | Initialises the I2C Transaction mode with the 7-bit device address&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 654: Line 666:
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
+
| width="90%" | DeviceAddress
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMDisable'''
 
|-
 
| colspan="2" | Disable a PWM output&nbsp;
 
 
|-
 
|-
 +
| colspan="2" | 7-bit Device Address&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
+
| width="90%" | Baud
 
|-
 
|-
| colspan="2" | Range: 0-11&nbsp;
+
| colspan="2" | 0=100KHz, 1=400KHz, 2=1MHz&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 677: Line 681:
  
  
 +
===I2CTransReceive===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CStart'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CTransReceive'''
 
|-
 
|-
| colspan="2" | Put the I2C Module into Start mode&nbsp;
+
| colspan="2" | Receives an I2C Transaction on the selected I2C channel. Returns the number of bytes received.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 690: Line 695:
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
+
| width="90%" | Data
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
 
|-
 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
+
| colspan="2" | Data variable to receive into&nbsp;
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPITransfer'''
 
 
|-
 
|-
| colspan="2" | Transfer a byte using the SPI bus&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Count
 
|-
 
|-
 +
| colspan="2" | Number of bytes to receive&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | DataOut
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===I2CTransSend===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CReceive'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CTransSend'''
 
|-
 
|-
| colspan="2" | Receive a byte using the I2C bus&nbsp;
+
| colspan="2" | Sends an I2C Transaction on the selected I2C channel. Returns the number of bytes sent.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 731: Line 724:
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Last
+
| width="90%" | Data
 
|-
 
|-
| colspan="2" | Last byte to receive: Range 0-1&nbsp;
+
| colspan="2" | Data to send&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Count
 +
|-
 +
| colspan="2" | Number of bytes to send out, MS bit 0x8000 signifies no Stop if set&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===IOGetInputPin===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireGetIDByte'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IOGetInputPin'''
 
|-
 
|-
| colspan="2" | Returns a single byte of the 64-Bit lasered ROM code, 255 on error&nbsp;
+
| colspan="2" | Sets the selected digital pin to an input and reads the input state.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
+
| width="90%" | Pin
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
+
| colspan="2" | Range: 0-29&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Device
 
|-
 
| colspan="2" | Device ID - Range: 0 - NumDevices - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ByteIndex
 
|-
 
| colspan="2" | Index of the data byte. 0=FamilyCode, 1-6=Serial, 7=CRC&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===IOSetOutputPin===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMSetFrequency'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IOSetOutputPin'''
 
|-
 
|-
| colspan="2" | Sets PWM frequency in Hz&nbsp;
+
| colspan="2" | Sets the selected digital pin to an output and assigns the output state.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
+
| width="90%" | Pin
 
|-
 
|-
| colspan="2" | Range: 0 - 11&nbsp;
+
| colspan="2" | Range: 0-29&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
+
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Frequency
+
| width="90%" | State
 
|-
 
|-
| colspan="2" | Frequency  (Hz)&nbsp;
+
| colspan="2" | Range: 0-1&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 792: Line 782:
  
  
 +
===Initialise===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CStop'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
|-
| colspan="2" | Put the I2C Module into Stop mode&nbsp;
+
| colspan="2" | Initialise the comms to the Arduino board ready for commands to be sent.&nbsp;
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
 
|-
 
|-
| colspan="2" | &nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 810: Line 796:
  
  
 +
===OneWireBusReset===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSetReferenceVoltage'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireBusReset'''
 
|-
 
|-
| colspan="2" | Specified the reference setting for ADC reads.&nbsp;
+
| colspan="2" | Issue a 'ping' on the bus. If there is at least one sensor on the bus then it will generate a presence pulse.  Returns 0 if a presense pulse was detected Returns 1 no device was detected&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | RefType
+
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | 0=AREF, 1=VCC, 3=Internal 1.1V&nbsp;
+
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===OneWireGetDeviceCount===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireSkipROM'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireGetDeviceCount'''
 
|-
 
|-
| colspan="2" | Performs a bus reset and the sends the SkipROM command byte&nbsp;
+
| colspan="2" | Returns the number of devices found by the last ScanBus operation.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 841: Line 829:
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===OneWireGetIDByte===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPIPrescaler'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireGetIDByte'''
 
|-
 
|-
| colspan="2" | Modify the speed of the SPI bus&nbsp;
+
| colspan="2" | Returns a single byte of the 64-Bit lasered ROM code, 255 on error&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 857: Line 846:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&nbsp;
+
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Device
 +
|-
 +
| colspan="2" | Device ID - Range: 0 - NumDevices - 1&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Prescaler
+
| width="90%" | ByteIndex
 
|-
 
|-
| colspan="2" | Range: 0-2&nbsp;
+
| colspan="2" | Index of the data byte. 0=FamilyCode, 1-6=Serial, 7=CRC&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===OneWireInitialise===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMSetDuty'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireInitialise'''
 
|-
 
|-
| colspan="2" | Sets the duty for the PWM output&nbsp;
+
| colspan="2" | Initialise the OneWire module ready for communications&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 880: Line 875:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Range: 0-11&nbsp;
+
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Duty
 
|-
 
| colspan="2" | &nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 892: Line 882:
  
  
 +
===OneWireMatchROM===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSample10'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireMatchROM'''
 
|-
 
|-
| colspan="2" | Reads the voltage present on an Analog pin as an 12-bit value range 0-4095&nbsp;
+
| colspan="2" | Performs a reset followed by the MatchROM code and then the 8-bit ROM code.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ADCChannel
+
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Range: 0, 3-7&nbsp;
+
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
+
| width="90%" | FamilyCode
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CTransSend'''
 
|-
 
| colspan="2" | Sends an I2C Transaction on the selected I2C channel. Returns the number of bytes sent.&nbsp;
 
 
|-
 
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
+
| width="90%" | SerialNumber
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
+
| colspan="2" | &nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" | Data
 
|-
 
| colspan="2" | Data to send&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Count
 
|-
 
| colspan="2" | Number of bytes to send out, MS bit 0x8000 signifies no Stop if set&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===OneWireReceiveByte===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CTransInit'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireReceiveByte'''
 
|-
 
|-
| colspan="2" | Initialises the I2C Transaction mode with the 7-bit device address&nbsp;
+
| colspan="2" | Receives a byte from the one wire bus a bit at a time&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 951: Line 925:
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | DeviceAddress
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|-
 
| colspan="2" | 7-bit Device Address&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Baud
 
|-
 
| colspan="2" | 0=100KHz, 1=400KHz, 2=1MHz&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
 
|}
 
|}
  
  
 +
===OneWireScanBus===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IOSetOutputPin'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireScanBus'''
 
|-
 
|-
| colspan="2" | Sets the selected digital pin to an output and assigns the output state.&nbsp;
+
| colspan="2" | Scans the one wire bus to detect all connected devices. Returns the number of one wire devices found.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Pin
+
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Range: 0-29&nbsp;
+
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | State
 
|-
 
| colspan="2" | Range: 0-1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===OneWireSkipROM===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTReceive'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireSkipROM'''
 
|-
 
|-
| colspan="2" | Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available.&nbsp;
+
| colspan="2" | Performs a bus reset and the sends the SkipROM command byte&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 1,000: Line 961:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
+
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===OneWireTransmitByte===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleAverage10'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireTransmitByte'''
 
|-
 
|-
| colspan="2" | Reads the voltage present on an Analog pin as an 10-bit value range 0-1023. Performs the selected number of samples with the selected time in microseconds in between samples&nbsp;
+
| colspan="2" | Transmit a byte to the one wire bus a bit at a time&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ADCChannel
+
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Range: 0, 3-7&nbsp;
+
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | SampleCount
+
| width="90%" | Data
 
|-
 
|-
| colspan="2" | Range: 1- 100&nbsp;
+
| colspan="2" | &nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" | SampleDelay
 
|-
 
| colspan="2" | Delay in us between each sample&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===PWMDisable===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireScanBus'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMDisable'''
 
|-
 
|-
| colspan="2" | Scans the one wire bus to detect all connected devices. Returns the number of one wire devices found.&nbsp;
+
| colspan="2" | Disable a PWM output&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 1,046: Line 1,004:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
+
| colspan="2" | Range: 0-11&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===PWMEnable===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPIInitialise'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMEnable'''
 
|-
 
|-
| colspan="2" | Initialsie the SPI module ready for communications&nbsp;
+
| colspan="2" | Enable a PWM output&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 1,064: Line 1,023:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&nbsp;
+
| colspan="2" | Range: 0-11&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 1,071: Line 1,030:
  
  
 +
===PWMSetDuty===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireReceiveByte'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMSetDuty'''
 
|-
 
|-
| colspan="2" | Receives a byte from the one wire bus a bit at a time&nbsp;
+
| colspan="2" | Sets the duty for the PWM output&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 1,082: Line 1,042:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
+
| colspan="2" | Range: 0-11&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Duty
 +
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===PWMSetFrequency===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CSend'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMSetFrequency'''
 
|-
 
|-
| colspan="2" | Transmit a byte using the I2C bus&nbsp;
+
| colspan="2" | Sets PWM frequency in Hz&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 1,100: Line 1,066:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
+
| colspan="2" | Range: 0 - 11&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
| width="90%" | DataOut
+
| width="90%" | Frequency
 
|-
 
|-
| colspan="2" | &nbsp;
+
| colspan="2" | Frequency  (Hz)&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===SPIInitialise===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTSend'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPIInitialise'''
 
|-
 
|-
| colspan="2" | Send a byte via the UART module&nbsp;
+
| colspan="2" | Initialsie the SPI module ready for communications&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 1,123: Line 1,090:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
+
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&nbsp;
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | Data Byte to send. Range: 0-255&nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 1,135: Line 1,097:
  
  
 +
===SPIPrescaler===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireGetDeviceCount'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPIPrescaler'''
 
|-
 
|-
| colspan="2" | Returns the number of devices found by the last ScanBus operation.&nbsp;
+
| colspan="2" | Modify the speed of the SPI bus&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 1,146: Line 1,109:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
+
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Prescaler
 +
|-
 +
| colspan="2" | Range: 0-2&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===SPITransfer===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMEnable'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPITransfer'''
 
|-
 
|-
| colspan="2" | Enable a PWM output&nbsp;
+
| colspan="2" | Transfer a byte using the SPI bus&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 1,164: Line 1,133:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Range: 0-11&nbsp;
+
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | DataOut
 +
|-
 +
| colspan="2" | &nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===SPITransferTrans===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleArray10'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPITransferTrans'''
 
|-
 
|-
| colspan="2" | Reads the voltage present on an Analog pin as an 10-bit value range 0-1023 Performs the selected number of samples with the selected time in microseconds in between samples and returns each sample in a single packet&nbsp;
+
| colspan="2" | Transfer an array of bytes using the SPI bus&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ADCChannel
+
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Range: 0, 3-7&nbsp;
+
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | SampleCount
+
| width="90%" | Count
 
|-
 
|-
| colspan="2" | Range: 1- 32&nbsp;
+
| colspan="2" | Number of bytes to send and receive&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | SampleDelay
+
| width="90%" | DataOut
 
|-
 
|-
| colspan="2" | Delay in us between each sample&nbsp;
+
| colspan="2" | Outgoing data&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Samples
+
| width="90%" | DataIn
 
|-
 
|-
| colspan="2" | 10-bit samples returned from the function&nbsp;
+
| colspan="2" | Incoming data&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 1,204: Line 1,179:
  
  
 +
===UARTBaud===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleAverage8'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTBaud'''
 
|-
 
|-
| colspan="2" | Reads the voltage present on an Analog pin as an 8-bit value range 0-255 Performs the selected number of samples with the selected time in microseconds in between samples&nbsp;
+
| colspan="2" | Control the communications rate of the UART module&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ADCChannel
+
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Range: 0, 3-7&nbsp;
+
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | SampleCount
+
| width="90%" | Rate
 
|-
 
|-
| colspan="2" | Range: 1- 100&nbsp;
+
| colspan="2" | 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" | SampleDelay
 
|-
 
| colspan="2" | Delay in us between each sample&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===UARTCheckRX===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTCheckRX'''
 +
|-
 +
| colspan="2" | Check to see if the UART module has received any data&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Initialise the comms to the Arduino board ready for commands to be sent.&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 
|-
 
|-
 +
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 
+
===UARTInitialise===
 
 
==Property reference==
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTInitialise'''
 
|-
 
|-
 +
| colspan="2" | Initialise the UART module ready for communications&nbsp;
 
|-
 
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connection
 
 
|-
 
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
+
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
| width="90%" | ESP IP Address
 
 
|-
 
|-
| colspan="2" | IP Address of the Raspbery Pi we want to control&nbsp;
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
 +
 
 +
===UARTReceive===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" | ESP Port
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTReceive'''
 
|-
 
|-
| colspan="2" | Port number we want to communicate on. Default 1234&nbsp;
+
| colspan="2" | Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available.&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Network Interface
 
 
|-
 
|-
| colspan="2" | Some computers may have several network interfaces such as ethernet ports and wifi access. Select the correct network interface for the network you wish to connect to. Use the IP address to confirm you are connected to the right network.&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
+
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
| width="90%" | IP Address
 
 
|-
 
|-
| colspan="2" | IP Address of the selected network interface.&nbsp;
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
 +
 
 +
===UARTSend===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | API Peripherals
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTSend'''
 
|-
 
|-
 +
| colspan="2" | Send a byte via the UART module&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | Digital IO
 
 
|-
 
|-
| colspan="2" | &nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
+
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
| width="90%" | Analog Input
 
 
|-
 
|-
| colspan="2" | &nbsp;
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
|-
+
| width="90%" | Data
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | Analog Output
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | PWM Output
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | I2C Bus
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | SPI Bus
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | UART
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | OneWire
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | SERVO
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Console
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Console Log
 
|-
 
| colspan="2" | Create an automatic console log of the commands sent to the ESP&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Log Mode
 
|-
 
| colspan="2" | Controls how the console data is formatted. Fixed statistics gives an easy to read overview of the IO, Analog and PWM functionality Command Log gives a more in depth analysis of the outgoing commands and incoming returns ASCII mode allows serial data to be shown in raw text form, other commands are shown as in the Command Log mode&nbsp;
 
|}==Macro reference==
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CInitialise'''
 
|-
 
| colspan="2" | Initialise the I2C module ready for communications&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Baud
 
|-
 
| colspan="2" | 0=100KHz, 1=400KHz, 2=1MHz&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleArray8'''
 
|-
 
| colspan="2" | Reads the voltage present on an Analog pin as an 8-bit value range 0-255 Performs the selected number of samples with the selected time in microseconds in between samples and returns each sample in a single packet&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ADCChannel
 
|-
 
| colspan="2" | Range: 0, 3-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | SampleCount
 
|-
 
| colspan="2" | Range: 1- 32&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | SampleDelay
 
|-
 
| colspan="2" | Delay in us between each sample&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Samples
 
|-
 
| colspan="2" | 8-bit samples returned from the function&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPITransferTrans'''
 
|-
 
| colspan="2" | Transfer an array of bytes using the SPI bus&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Count
 
|-
 
| colspan="2" | Number of bytes to send and receive&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | DataOut
 
|-
 
| colspan="2" | Outgoing data&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | DataIn
 
|-
 
| colspan="2" | Incoming data&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireBusReset'''
 
|-
 
| colspan="2" | Issue a 'ping' on the bus. If there is at least one sensor on the bus then it will generate a presence pulse.  Returns 0 if a presense pulse was detected Returns 1 no device was detected&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IOGetInputPin'''
 
|-
 
| colspan="2" | Sets the selected digital pin to an input and reads the input state.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Pin
 
|-
 
| colspan="2" | Range: 0-29&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTBaud'''
 
|-
 
| colspan="2" | Control the communications rate of the UART module&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Rate
 
|-
 
| colspan="2" | 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireInitialise'''
 
|-
 
| colspan="2" | Initialise the OneWire module ready for communications&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireMatchROM'''
 
|-
 
| colspan="2" | Performs a reset followed by the MatchROM code and then the 8-bit ROM code.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | FamilyCode
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | SerialNumber
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSample8'''
 
|-
 
| colspan="2" | Reads the voltage present on an Analog pin as an 8-bit value range 0-255&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ADCChannel
 
|-
 
| colspan="2" | Range: 0, 3-7&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CTransReceive'''
 
|-
 
| colspan="2" | Receives an I2C Transaction on the selected I2C channel. Returns the number of bytes received.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | Data variable to receive into&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Count
 
|-
 
| colspan="2" | Number of bytes to receive&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTInitialise'''
 
|-
 
| colspan="2" | Initialise the UART module ready for communications&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTCheckRX'''
 
|-
 
| colspan="2" | Check to see if the UART module has received any data&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSetPrechargeTime'''
 
|-
 
| colspan="2" | Specifies the precharge time for the ADC input readings in microseconds. The longer the time the more immune to noise the reading will be.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ChargeTime
 
|-
 
| colspan="2" | Default 10&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireTransmitByte'''
 
|-
 
| colspan="2" | Transmit a byte to the one wire bus a bit at a time&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CRestart'''
 
|-
 
| colspan="2" | Put the I2C Module into Restart mode&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMDisable'''
 
|-
 
| colspan="2" | Disable a PWM output&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range: 0-11&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CStart'''
 
|-
 
| colspan="2" | Put the I2C Module into Start mode&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPITransfer'''
 
|-
 
| colspan="2" | Transfer a byte using the SPI bus&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | DataOut
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CReceive'''
 
|-
 
| colspan="2" | Receive a byte using the I2C bus&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | Last
 
|-
 
| colspan="2" | Last byte to receive: Range 0-1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireGetIDByte'''
 
|-
 
| colspan="2" | Returns a single byte of the 64-Bit lasered ROM code, 255 on error&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Device
 
|-
 
| colspan="2" | Device ID - Range: 0 - NumDevices - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ByteIndex
 
|-
 
| colspan="2" | Index of the data byte. 0=FamilyCode, 1-6=Serial, 7=CRC&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMSetFrequency'''
 
|-
 
| colspan="2" | Sets PWM frequency in Hz&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range: 0 - 11&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
 
| width="90%" | Frequency
 
|-
 
| colspan="2" | Frequency  (Hz)&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CStop'''
 
|-
 
| colspan="2" | Put the I2C Module into Stop mode&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSetReferenceVoltage'''
 
|-
 
| colspan="2" | Specified the reference setting for ADC reads.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | RefType
 
|-
 
| colspan="2" | 0=AREF, 1=VCC, 3=Internal 1.1V&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireSkipROM'''
 
|-
 
| colspan="2" | Performs a bus reset and the sends the SkipROM command byte&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPIPrescaler'''
 
|-
 
| colspan="2" | Modify the speed of the SPI bus&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Prescaler
 
|-
 
| colspan="2" | Range: 0-2&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMSetDuty'''
 
|-
 
| colspan="2" | Sets the duty for the PWM output&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range: 0-11&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Duty
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSample10'''
 
|-
 
| colspan="2" | Reads the voltage present on an Analog pin as an 12-bit value range 0-4095&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ADCChannel
 
|-
 
| colspan="2" | Range: 0, 3-7&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CTransSend'''
 
|-
 
| colspan="2" | Sends an I2C Transaction on the selected I2C channel. Returns the number of bytes sent.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | Data to send&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Count
 
|-
 
| colspan="2" | Number of bytes to send out, MS bit 0x8000 signifies no Stop if set&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CTransInit'''
 
|-
 
| colspan="2" | Initialises the I2C Transaction mode with the 7-bit device address&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | DeviceAddress
 
|-
 
| colspan="2" | 7-bit Device Address&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Baud
 
|-
 
| colspan="2" | 0=100KHz, 1=400KHz, 2=1MHz&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IOSetOutputPin'''
 
|-
 
| colspan="2" | Sets the selected digital pin to an output and assigns the output state.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Pin
 
|-
 
| colspan="2" | Range: 0-29&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | State
 
|-
 
| colspan="2" | Range: 0-1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTReceive'''
 
|-
 
| colspan="2" | Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleAverage10'''
 
|-
 
| colspan="2" | Reads the voltage present on an Analog pin as an 10-bit value range 0-1023. Performs the selected number of samples with the selected time in microseconds in between samples&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ADCChannel
 
|-
 
| colspan="2" | Range: 0, 3-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | SampleCount
 
|-
 
| colspan="2" | Range: 1- 100&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | SampleDelay
 
|-
 
| colspan="2" | Delay in us between each sample&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireScanBus'''
 
|-
 
| colspan="2" | Scans the one wire bus to detect all connected devices. Returns the number of one wire devices found.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPIInitialise'''
 
|-
 
| colspan="2" | Initialsie the SPI module ready for communications&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireReceiveByte'''
 
|-
 
| colspan="2" | Receives a byte from the one wire bus a bit at a time&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CSend'''
 
|-
 
| colspan="2" | Transmit a byte using the I2C bus&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | DataOut
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTSend'''
 
|-
 
| colspan="2" | Send a byte via the UART module&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | Data Byte to send. Range: 0-255&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireGetDeviceCount'''
 
|-
 
| colspan="2" | Returns the number of devices found by the last ScanBus operation.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMEnable'''
 
|-
 
| colspan="2" | Enable a PWM output&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range: 0-11&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleArray10'''
 
|-
 
| colspan="2" | Reads the voltage present on an Analog pin as an 10-bit value range 0-1023 Performs the selected number of samples with the selected time in microseconds in between samples and returns each sample in a single packet&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ADCChannel
 
|-
 
| colspan="2" | Range: 0, 3-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | SampleCount
 
|-
 
| colspan="2" | Range: 1- 32&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | SampleDelay
 
|-
 
| colspan="2" | Delay in us between each sample&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Samples
 
|-
 
| colspan="2" | 10-bit samples returned from the function&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleAverage8'''
 
|-
 
| colspan="2" | Reads the voltage present on an Analog pin as an 8-bit value range 0-255 Performs the selected number of samples with the selected time in microseconds in between samples&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ADCChannel
 
|-
 
| colspan="2" | Range: 0, 3-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | SampleCount
 
|-
 
| colspan="2" | Range: 1- 100&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | SampleDelay
 
|-
 
| colspan="2" | Delay in us between each sample&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
| colspan="2" | Initialise the comms to the Arduino board ready for commands to be sent.&nbsp;
 
 
|-
 
|-
 +
| colspan="2" | Data Byte to send. Range: 0-255&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  

Latest revision as of 08:30, 5 October 2023

Author Matrix TSL
Version 2.0
Category API Slave Devices


API (ESP32) component

Connects to an ESP32 device running the API Firmware allowing the board to become a slave to the Flowcode Embedded simulation or Flowcode App Developer. Supports: Digital IO / ADC / I2C / SPI / PWM / UART See Flowcode Help Wiki for firmware.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_ESP32_API_Comp.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_ESP32_API_Comp.fcfx

Detailed description

The App Developer (ESP32) component allows an ESP32 board to be controlled from within the Flowcode simulation runtime.

To allow Flowcode to communicate and control the ESP32 hardware the board must first be pre-programmed with dedicated firmware.

The firmware source project can be downloaded from here.

You will need to set your WIFI SSID and Password near the top of Main to allow the ESP module to connect to your network.

ZIP Icon.png ESP32 App Developer Firmware

More information about the workings of the firmware project can be found on the FiniteStateMachine page.


The IP Address to the ESP32 hardware is selected via the SCADA_ESP32 component IP Address property.

When building the component into a App Developer project remember to expose the IP Address property to allow the end user to select the address for the hardware.


The console window can display data in two modes which is set via a component property.

  • fixed statistics showing IO / ADC inputs / PWM
  • scrolling log showing all commands and returns

Examples

Pin Mapping

Here is a table showing how the App Developer Slave digital pins are mapped on the device.

Please note pins 34, 35, 36, 39 are only capable of digital inputs and cannot be used as digital outputs.

App Developer Slave Digital Pin 0 1 2 3 4 5 12 13 14 15 16 17 18 19 21 22 23 25 26 27 32 33 34 35 36 39
Device Port Pin A0 A1 A2 A3 A4 A5 A12 A13 A14 A15 A16 A17 A18 A19 A21 A22 A23 A25 A26 A27 B0 B1 B2 B3 B4 B7
GPIO Number 0 1 2 3 4 5 12 13 14 15 16 17 18 19 21 22 23 25 26 27 32 33 34 35 36 39


Here is a table showing how the App Developer Slave analogue pins are mapped on the device.

Please note not all analogue input pins are available as peripheral ADC2 is not accesible when WIFI/Bluetooth is active. Only the pins shown are available.

App Developer Slave Analogue Pin 0 3 4 5 6 7
Device Port Pin B4 B7 B0 B1 B2 B3
GPIO Number 36 39 32 33 34 35


Here is a table showing how the App Developer Slave peripheral pins are mapped on the device.

Please note that PWM channels are tied in pairs and so channel 0 and 1 use the same internal timer peripheral. They will always run at the same frequency and when enabling channel 1 channel 0 duty will be reset to 0% and visa versa.


App Developer Slave Peripheral Pin I2C 0 SDA I2C 0 SCL I2C 1 SDA I2C 1 SCL SPI 0 MOSI SPI 0 MISO SPI 0 SCK SPI 1 MOSI SPI 1 MISO SPI 1 SCK UART 0 RX UART 0 TX UART 1 RX UART 1 TX PWM 0 PWM 1 PWM 2 PWM 3 PWM 4 PWM 5 PWM 6 PWM 7 PWM 8 PWM 9 PWM 10 PWM 11 OneWire
Device Port Pin A13 A12 A15 A14 A13 A12 A14 A23 A19 A18 A26 A25 B0 B1 A0 A2 A4 A5 A12 A13 A14 A15 A16 A17 A18 A19 A21
GPIO Number 13 12 15 14 13 12 14 23 19 18 26 25 32 33 0 2 4 5 12 13 14 15 16 17 18 19 21


PortA = GPIO pins 0 - 31 : A0 = GPIO 0

PortB = GPIO pins 32 - 39 : B0 = GPIO 32

Macro reference

ADCSample10

Fc9-comp-macro.png ADCSample10
Reads the voltage present on an Analog pin as an 12-bit value range 0-4095 
Fc9-u8-icon.png - BYTE ADCChannel
Range: 0, 3-7 
Fc9-u16-icon.png - UINT Return


ADCSample8

Fc9-comp-macro.png ADCSample8
Reads the voltage present on an Analog pin as an 8-bit value range 0-255 
Fc9-u8-icon.png - BYTE ADCChannel
Range: 0, 3-7 
Fc9-u8-icon.png - BYTE Return


ADCSampleArray10

Fc9-comp-macro.png ADCSampleArray10
Reads the voltage present on an Analog pin as an 10-bit value range 0-1023 Performs the selected number of samples with the selected time in microseconds in between samples and returns each sample in a single packet 
Fc9-u8-icon.png - BYTE ADCChannel
Range: 0, 3-7 
Fc9-u8-icon.png - BYTE SampleCount
Range: 1- 32 
Fc9-u16-icon.png - UINT SampleDelay
Delay in us between each sample 
Fc9-u16-icon.png - UINT Samples
10-bit samples returned from the function 
Fc9-void-icon.png - VOID Return


ADCSampleArray8

Fc9-comp-macro.png ADCSampleArray8
Reads the voltage present on an Analog pin as an 8-bit value range 0-255 Performs the selected number of samples with the selected time in microseconds in between samples and returns each sample in a single packet 
Fc9-u8-icon.png - BYTE ADCChannel
Range: 0, 3-7 
Fc9-u8-icon.png - BYTE SampleCount
Range: 1- 32 
Fc9-u16-icon.png - UINT SampleDelay
Delay in us between each sample 
Fc9-u8-icon.png - BYTE Samples
8-bit samples returned from the function 
Fc9-void-icon.png - VOID Return


ADCSampleAverage10

Fc9-comp-macro.png ADCSampleAverage10
Reads the voltage present on an Analog pin as an 10-bit value range 0-1023. Performs the selected number of samples with the selected time in microseconds in between samples 
Fc9-u8-icon.png - BYTE ADCChannel
Range: 0, 3-7 
Fc9-u8-icon.png - BYTE SampleCount
Range: 1- 100 
Fc9-u8-icon.png - BYTE SampleDelay
Delay in us between each sample 
Fc9-u16-icon.png - UINT Return


ADCSampleAverage8

Fc9-comp-macro.png ADCSampleAverage8
Reads the voltage present on an Analog pin as an 8-bit value range 0-255 Performs the selected number of samples with the selected time in microseconds in between samples 
Fc9-u8-icon.png - BYTE ADCChannel
Range: 0, 3-7 
Fc9-u8-icon.png - BYTE SampleCount
Range: 1- 100 
Fc9-u8-icon.png - BYTE SampleDelay
Delay in us between each sample 
Fc9-u8-icon.png - BYTE Return


ADCSetPrechargeTime

Fc9-comp-macro.png ADCSetPrechargeTime
Specifies the precharge time for the ADC input readings in microseconds. The longer the time the more immune to noise the reading will be. 
Fc9-u8-icon.png - BYTE ChargeTime
Default 10 
Fc9-void-icon.png - VOID Return


ADCSetReferenceVoltage

Fc9-comp-macro.png ADCSetReferenceVoltage
Specified the reference setting for ADC reads. 
Fc9-u8-icon.png - BYTE RefType
0=AREF, 1=VCC, 3=Internal 1.1V 
Fc9-void-icon.png - VOID Return


I2CInitialise

Fc9-comp-macro.png I2CInitialise
Initialise the I2C module ready for communications 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Baud
0=100KHz, 1=400KHz, 2=1MHz 
Fc9-void-icon.png - VOID Return


I2CReceive

Fc9-comp-macro.png I2CReceive
Receive a byte using the I2C bus 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-bool-icon.png - BOOL Last
Last byte to receive: Range 0-1 
Fc9-u8-icon.png - BYTE Return


I2CRestart

Fc9-comp-macro.png I2CRestart
Put the I2C Module into Restart mode 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-void-icon.png - VOID Return


I2CSend

Fc9-comp-macro.png I2CSend
Transmit a byte using the I2C bus 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE DataOut
 
Fc9-bool-icon.png - BOOL Return


I2CStart

Fc9-comp-macro.png I2CStart
Put the I2C Module into Start mode 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-void-icon.png - VOID Return


I2CStop

Fc9-comp-macro.png I2CStop
Put the I2C Module into Stop mode 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-void-icon.png - VOID Return


I2CTransInit

Fc9-comp-macro.png I2CTransInit
Initialises the I2C Transaction mode with the 7-bit device address 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE DeviceAddress
7-bit Device Address 
Fc9-u8-icon.png - BYTE Baud
0=100KHz, 1=400KHz, 2=1MHz 
Fc9-void-icon.png - VOID Return


I2CTransReceive

Fc9-comp-macro.png I2CTransReceive
Receives an I2C Transaction on the selected I2C channel. Returns the number of bytes received. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Data
Data variable to receive into 
Fc9-u16-icon.png - UINT Count
Number of bytes to receive 
Fc9-u16-icon.png - UINT Return


I2CTransSend

Fc9-comp-macro.png I2CTransSend
Sends an I2C Transaction on the selected I2C channel. Returns the number of bytes sent. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Data
Data to send 
Fc9-u16-icon.png - UINT Count
Number of bytes to send out, MS bit 0x8000 signifies no Stop if set 
Fc9-u16-icon.png - UINT Return


IOGetInputPin

Fc9-comp-macro.png IOGetInputPin
Sets the selected digital pin to an input and reads the input state. 
Fc9-u8-icon.png - BYTE Pin
Range: 0-29 
Fc9-bool-icon.png - BOOL Return


IOSetOutputPin

Fc9-comp-macro.png IOSetOutputPin
Sets the selected digital pin to an output and assigns the output state. 
Fc9-u8-icon.png - BYTE Pin
Range: 0-29 
Fc9-bool-icon.png - BOOL State
Range: 0-1 
Fc9-void-icon.png - VOID Return


Initialise

Fc9-comp-macro.png Initialise
Initialise the comms to the Arduino board ready for commands to be sent. 
Fc9-void-icon.png - VOID Return


OneWireBusReset

Fc9-comp-macro.png OneWireBusReset
Issue a 'ping' on the bus. If there is at least one sensor on the bus then it will generate a presence pulse. Returns 0 if a presense pulse was detected Returns 1 no device was detected 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-bool-icon.png - BOOL Return


OneWireGetDeviceCount

Fc9-comp-macro.png OneWireGetDeviceCount
Returns the number of devices found by the last ScanBus operation. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


OneWireGetIDByte

Fc9-comp-macro.png OneWireGetIDByte
Returns a single byte of the 64-Bit lasered ROM code, 255 on error 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Device
Device ID - Range: 0 - NumDevices - 1 
Fc9-u8-icon.png - BYTE ByteIndex
Index of the data byte. 0=FamilyCode, 1-6=Serial, 7=CRC 
Fc9-u8-icon.png - BYTE Return


OneWireInitialise

Fc9-comp-macro.png OneWireInitialise
Initialise the OneWire module ready for communications 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-void-icon.png - VOID Return


OneWireMatchROM

Fc9-comp-macro.png OneWireMatchROM
Performs a reset followed by the MatchROM code and then the 8-bit ROM code. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE FamilyCode
 
Fc9-u8-icon.png - BYTE SerialNumber
 
Fc9-void-icon.png - VOID Return


OneWireReceiveByte

Fc9-comp-macro.png OneWireReceiveByte
Receives a byte from the one wire bus a bit at a time 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


OneWireScanBus

Fc9-comp-macro.png OneWireScanBus
Scans the one wire bus to detect all connected devices. Returns the number of one wire devices found. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


OneWireSkipROM

Fc9-comp-macro.png OneWireSkipROM
Performs a bus reset and the sends the SkipROM command byte 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-void-icon.png - VOID Return


OneWireTransmitByte

Fc9-comp-macro.png OneWireTransmitByte
Transmit a byte to the one wire bus a bit at a time 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


PWMDisable

Fc9-comp-macro.png PWMDisable
Disable a PWM output 
Fc9-u8-icon.png - BYTE Channel
Range: 0-11 
Fc9-void-icon.png - VOID Return


PWMEnable

Fc9-comp-macro.png PWMEnable
Enable a PWM output 
Fc9-u8-icon.png - BYTE Channel
Range: 0-11 
Fc9-void-icon.png - VOID Return


PWMSetDuty

Fc9-comp-macro.png PWMSetDuty
Sets the duty for the PWM output 
Fc9-u8-icon.png - BYTE Channel
Range: 0-11 
Fc9-u8-icon.png - BYTE Duty
 
Fc9-void-icon.png - VOID Return


PWMSetFrequency

Fc9-comp-macro.png PWMSetFrequency
Sets PWM frequency in Hz 
Fc9-u8-icon.png - BYTE Channel
Range: 0 - 11 
Fc9-s32-icon.png - LONG Frequency
Frequency (Hz) 
Fc9-void-icon.png - VOID Return


SPIInitialise

Fc9-comp-macro.png SPIInitialise
Initialsie the SPI module ready for communications 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - SPI Bus Count - 1 
Fc9-void-icon.png - VOID Return


SPIPrescaler

Fc9-comp-macro.png SPIPrescaler
Modify the speed of the SPI bus 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - SPI Bus Count - 1 
Fc9-u8-icon.png - BYTE Prescaler
Range: 0-2 
Fc9-void-icon.png - VOID Return


SPITransfer

Fc9-comp-macro.png SPITransfer
Transfer a byte using the SPI bus 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - SPI Bus Count - 1 
Fc9-u8-icon.png - BYTE DataOut
 
Fc9-u8-icon.png - BYTE Return


SPITransferTrans

Fc9-comp-macro.png SPITransferTrans
Transfer an array of bytes using the SPI bus 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - SPI Bus Count - 1 
Fc9-u16-icon.png - UINT Count
Number of bytes to send and receive 
Fc9-u8-icon.png - BYTE DataOut
Outgoing data 
Fc9-u8-icon.png - BYTE DataIn
Incoming data 
Fc9-void-icon.png - VOID Return


UARTBaud

Fc9-comp-macro.png UARTBaud
Control the communications rate of the UART module 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - UART Bus Count - 1 
Fc9-u8-icon.png - BYTE Rate
0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200 
Fc9-void-icon.png - VOID Return


UARTCheckRX

Fc9-comp-macro.png UARTCheckRX
Check to see if the UART module has received any data 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - UART Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


UARTInitialise

Fc9-comp-macro.png UARTInitialise
Initialise the UART module ready for communications 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - UART Bus Count - 1 
Fc9-void-icon.png - VOID Return


UARTReceive

Fc9-comp-macro.png UARTReceive
Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - UART Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


UARTSend

Fc9-comp-macro.png UARTSend
Send a byte via the UART module 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - UART Bus Count - 1 
Fc9-u8-icon.png - BYTE Data
Data Byte to send. Range: 0-255 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Connection
Fc9-type-10-icon.png ESP IP Address
IP Address of the Raspbery Pi we want to control 
Fc9-type-21-icon.png ESP Port
Port number we want to communicate on. Default 1234 
Fc9-type-16-icon.png Network Interface
Some computers may have several network interfaces such as ethernet ports and wifi access. Select the correct network interface for the network you wish to connect to. Use the IP address to confirm you are connected to the right network. 
Fc9-type-10-icon.png IP Address
IP Address of the selected network interface. 
Fc9-conn-icon.png API Peripherals
Fc9-type-21-icon.png Digital IO
 
Fc9-type-21-icon.png Analog Input
 
Fc9-type-21-icon.png Analog Output
 
Fc9-type-21-icon.png PWM Output
 
Fc9-type-21-icon.png I2C Bus
 
Fc9-type-21-icon.png SPI Bus
 
Fc9-type-21-icon.png UART
 
Fc9-type-21-icon.png OneWire
 
Fc9-type-21-icon.png SERVO
 
Fc9-conn-icon.png Console
Fc9-type-7-icon.png Console Log
Create an automatic console log of the commands sent to the ESP 
Fc9-type-16-icon.png Log Mode
Controls how the console data is formatted. Fixed statistics gives an easy to read overview of the IO, Analog and PWM functionality Command Log gives a more in depth analysis of the outgoing commands and incoming returns ASCII mode allows serial data to be shown in raw text form, other commands are shown as in the Command Log mode