Difference between revisions of "Component: API (BL0032) (API Slave Devices)"
Line 22: | Line 22: | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 70: | Line 72: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Line 368: | Line 372: | ||
==Macro reference== | ==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" | Initialsie the I2C module ready for communications | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Baud | ||
+ | |- | ||
+ | | colspan="2" | 0=100KHz, 1=400KHz, 2=1MHz | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | ADCChannel | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-5 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | SampleCount | ||
+ | |- | ||
+ | | colspan="2" | Range: 1- 32 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | SampleDelay | ||
+ | |- | ||
+ | | colspan="2" | Delay in us between each sample | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Samples | ||
+ | |- | ||
+ | | colspan="2" | 8-bit samples returned from the function | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Count | ||
+ | |- | ||
+ | | colspan="2" | Number of bytes to send and receive | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DataOut | ||
+ | |- | ||
+ | | colspan="2" | Outgoing data | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DataIn | ||
+ | |- | ||
+ | | colspan="2" | Incoming data | ||
+ | |- | ||
+ | | 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;" | '''IOGetInputPin''' | ||
+ | |- | ||
+ | | colspan="2" | Sets the selected digital pin to an input and reads the input state. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Pin | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-47 ... Pin 34 unimplemented | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - UART Bus Count - 1 | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | ADCChannel | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-31 ... Channels 16-23 unimplemented | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Data variable to receive into | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Count | ||
+ | |- | ||
+ | | colspan="2" | Number of bytes to receive | ||
+ | |- | ||
+ | | 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;" | '''UARTCheckRX''' | ||
+ | |- | ||
+ | | colspan="2" | Check to see if the UART module has received any data | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - UART Bus Count - 1 | ||
+ | |- | ||
+ | | 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;" | '''UARTInitialise''' | ||
+ | |- | ||
+ | | colspan="2" | Initialise the UART module ready for communications | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - UART Bus Count - 1 | ||
+ | |- | ||
+ | | 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;" | '''RegisterWrite''' | ||
+ | |- | ||
+ | | colspan="2" | Writes to one of the registers on-board the device | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | RegisterAddress | ||
+ | |- | ||
+ | | colspan="2" | The address of the register | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | The data value to assign to the register | ||
+ | |- | ||
+ | | 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;" | '''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. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | ChargeTime | ||
+ | |- | ||
+ | | colspan="2" | Default 10 | ||
+ | |- | ||
+ | | 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;" | '''RegisterRead''' | ||
+ | |- | ||
+ | | colspan="2" | Read one of the registers on-board the device | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | RegisterAddress | ||
+ | |- | ||
+ | | colspan="2" | The address of the register | ||
+ | |- | ||
+ | | 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;" | '''I2CRestart''' | ||
+ | |- | ||
+ | | colspan="2" | Put the I2C Module into Restart mode | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-15 | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DataOut | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | Last | ||
+ | |- | ||
+ | | colspan="2" | Last byte to receive: Range 0-1 | ||
+ | |- | ||
+ | | 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;" | '''I2CStop''' | ||
+ | |- | ||
+ | | colspan="2" | Put the I2C Module into Stop mode | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | RefType | ||
+ | |- | ||
+ | | colspan="2" | 0=AREF, 1=VCC, 3=Internal 1.1V | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Prescaler | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-2 | ||
+ | |- | ||
+ | | 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;" | '''ADCSample12''' | ||
+ | |- | ||
+ | | colspan="2" | Reads the voltage present on an Analog pin as an 12-bit value range 0-4095 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | ADCChannel | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-31 ... Channels 16-23 unimplemented | ||
+ | |- | ||
+ | | 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;" | '''PWMSetDuty''' | ||
+ | |- | ||
+ | | colspan="2" | Sets the duty for the PWM output | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-15 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Duty | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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;" | '''I2CTransSend''' | ||
+ | |- | ||
+ | | colspan="2" | Sends an I2C Transaction on the selected I2C channel. Returns the number of bytes sent. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Data to send | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DeviceAddress | ||
+ | |- | ||
+ | | colspan="2" | 7-bit Device Address | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Baud | ||
+ | |- | ||
+ | | colspan="2" | 0=100KHz, 1=400KHz, 2=1MHz | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Pin | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-47 ... Pin 34 unimplemented | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | State | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-1 | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - UART Bus Count - 1 | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | ADCChannel | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-5 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | SampleCount | ||
+ | |- | ||
+ | | colspan="2" | Range: 1- 100 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | SampleDelay | ||
+ | |- | ||
+ | | colspan="2" | Delay in us between each sample | ||
+ | |- | ||
+ | | 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;" | '''SPIInitialise''' | ||
+ | |- | ||
+ | | colspan="2" | Initialsie the SPI module ready for communications | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1 | ||
+ | |- | ||
+ | | 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;" | '''I2CSend''' | ||
+ | |- | ||
+ | | colspan="2" | Transmit a byte using the I2C bus | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DataOut | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - UART Bus Count - 1 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Data Byte to send. Range: 0-255 | ||
+ | |- | ||
+ | | 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;" | '''PWMSetPrescaler''' | ||
+ | |- | ||
+ | | colspan="2" | Sets the prescaler for the PWM output | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-15 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Prescaler | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Period | ||
+ | |- | ||
+ | | colspan="2" | Default 255 | ||
+ | |- | ||
+ | | 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;" | '''PWMEnable''' | ||
+ | |- | ||
+ | | colspan="2" | Enable a PWM output | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-15 | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | ADCChannel | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-5 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | SampleCount | ||
+ | |- | ||
+ | | colspan="2" | Range: 1- 32 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | SampleDelay | ||
+ | |- | ||
+ | | colspan="2" | Delay in us between each sample | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Samples | ||
+ | |- | ||
+ | | colspan="2" | 10-bit samples returned from the function | ||
+ | |- | ||
+ | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | ADCChannel | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-5 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | SampleCount | ||
+ | |- | ||
+ | | colspan="2" | Range: 1- 100 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | SampleDelay | ||
+ | |- | ||
+ | | colspan="2" | Delay in us between each sample | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Property reference== | ||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | ||
+ | |- | ||
+ | |- | ||
+ | | 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-type-7-icon.png]] | ||
+ | | width="90%" | Auto Detect Port | ||
+ | |- | ||
+ | | colspan="2" | Allows the component to auto detect the interface board COM port. Requires the latest Flowcode serial comms DLL to function correctly. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | COM Port | ||
+ | |- | ||
+ | | colspan="2" | Lists all the current available COM port hardware on your PC. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | Refresh Ports | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | API Peripherals | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Digital IO | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Analog Input | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Analog Output | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | PWM Output | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | I2C Bus | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | SPI Bus | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | UART | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | SERVO | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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 Arduino | ||
+ | |- | ||
+ | | 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 | ||
+ | |}==Macro reference== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
Revision as of 09:54, 27 January 2023
Author | Matrix TSL |
Version | 2.1 |
Category | API Slave Devices |
Contents
API (BL0032) component
Connects to an BL0032 dsPIC 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 / UART / PWM See Flowcode Help Wiki for firmware.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_BL0032_API_Comp.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_BL0032_API_Comp.fcfx
Detailed description
The App Developer (BL0032 dsPIC E-Block) component allows an BL0032 dsPIC E-block board to be controlled from within the Flowcode simulation runtime.
To allow Flowcode to communicate and control the Arduino Uno hardware the board must first be pre-programmed with dedicated firmware.
The firmware hex file and Flowcode source project can be downloaded from here.
BL0032 dsPIC App Developer Firmware
More information about the workings of the firmware project can be found on the FiniteStateMachine page.
The USB should be connected to the Target port on the E-block board to allow Flowcode to communicate with the Target microcontroller.
The COM port to the E-block hardware is selected via the SCADA_BL0032 component COM port property.
When building the component into a App Developer project remember to expose the COM port property to allow the end user to select the correct port 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 slave digital pins are mapped on the device.
App Developer Slave Digital Pin | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
Device Port Pin | B0 | B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8 | B9 | B10 | B11 | B12 | B13 | B14 | B15 | D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 | E0 | E1 | E2 | E3 | E4 | E5 | E6 | E7 | F0 | F1 | F3 | F4 | F5 | C13 | C14 | D8 | D9 | D10 | D11 | G6 | G7 | G8 | G9 |
Here is a table showing how the slave analogue pins are mapped on the device.
App Developer Slave Analogue Pin | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Device Port Pin | B0 | B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8 | B9 | B10 | B11 | B12 | B13 | B14 | B15 | E0 | E1 | E2 | E3 | E4 | E5 | E6 | E7 |
Here is a table showing how the slave peripheral pins are mapped on the device.
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 | SPI 2 MOSI | SPI 2 MISO | SPI 2 SCK | SPI 3 MOSI | SPI 3 MISO | SPI 3 SCK | UART 0 RX | UART 0 TX | UART 1 RX | UART 1 TX | UART 2 RX | UART 2 TX | UART 3 RX | UART 3 TX |
Device Port Pin | D9 | D10 | F4 | F5 | D3 | D4 | D5 | G8 | G7 | G6 | E0 | E1 | E2 | F3 | F4 | F5 | F0 | F1 | D0 | D1 | G9 | G8 | G7 | G6 |
App Developer Slave Peripheral Pin | PWM 0 | PWM 1 | PWM 2 | PWM 3 | PWM 4 | PWM 5 | PWM 6 | PWM 7 | PWM 8 | PWM 9 | PWM 10 | PWM 11 | PWM 12 | PWM 13 | PWM 14 | PWM 15 |
Device Port Pin | D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 | F0 | F1 | F3 | F4 | F5 | E0 | E2 | E4 |
Macro reference
I2CInitialise | |
Initialsie the I2C module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BYTE | Baud |
0=100KHz, 1=400KHz, 2=1MHz | |
- VOID | Return |
IOGetInputPin | |
Sets the selected digital pin to an input and reads the input state. | |
- BYTE | Pin |
Range: 0-47 ... Pin 34 unimplemented | |
- BOOL | Return |
ADCSample8 | |
Reads the voltage present on an Analog pin as an 8-bit value range 0-255 | |
- BYTE | ADCChannel |
Range: 0-31 ... Channels 16-23 unimplemented | |
- BYTE | Return |
UARTCheckRX | |
Check to see if the UART module has received any data | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Return |
UARTInitialise | |
Initialise the UART module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- VOID | Return |
RegisterWrite | |
Writes to one of the registers on-board the device | |
- UINT | RegisterAddress |
The address of the register | |
- UINT | Data |
The data value to assign to the register | |
- VOID | Return |
RegisterRead | |
Read one of the registers on-board the device | |
- UINT | RegisterAddress |
The address of the register | |
- UINT | Return |
I2CRestart | |
Put the I2C Module into Restart mode | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- VOID | Return |
PWMDisable | |
Disable a PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- VOID | Return |
I2CStart | |
Put the I2C Module into Start mode | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- VOID | Return |
SPITransfer | |
Transfer a byte using the SPI bus | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- BYTE | DataOut |
- BYTE | Return |
I2CReceive | |
Receive a byte using the I2C bus | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BOOL | Last |
Last byte to receive: Range 0-1 | |
- BYTE | Return |
I2CStop | |
Put the I2C Module into Stop mode | |
- BYTE | Channel |
- VOID | Return |
ADCSetReferenceVoltage | |
Specified the reference setting for ADC reads. | |
- BYTE | RefType |
0=AREF, 1=VCC, 3=Internal 1.1V | |
- VOID | Return |
SPIPrescaler | |
Modify the speed of the SPI bus | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- BYTE | Prescaler |
Range: 0-2 | |
- VOID | Return |
ADCSample12 | |
Reads the voltage present on an Analog pin as an 12-bit value range 0-4095 | |
- BYTE | ADCChannel |
Range: 0-31 ... Channels 16-23 unimplemented | |
- UINT | Return |
PWMSetDuty | |
Sets the duty for the PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- BYTE | Duty |
- VOID | Return |
IOSetOutputPin | |
Sets the selected digital pin to an output and assigns the output state. | |
- BYTE | Pin |
Range: 0-47 ... Pin 34 unimplemented | |
- BOOL | State |
Range: 0-1 | |
- VOID | Return |
UARTReceive | |
Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Return |
SPIInitialise | |
Initialsie the SPI module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- VOID | Return |
I2CSend | |
Transmit a byte using the I2C bus | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BYTE | DataOut |
- BOOL | Return |
UARTSend | |
Send a byte via the UART module | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Data |
Data Byte to send. Range: 0-255 | |
- VOID | Return |
PWMSetPrescaler | |
Sets the prescaler for the PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- BYTE | Prescaler |
- BYTE | Period |
Default 255 | |
- VOID | Return |
PWMEnable | |
Enable a PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- VOID | Return |
Initialise | |
Initialise the comms to the Arduino board ready for commands to be sent. | |
- VOID | Return |
Property reference
==Macro reference==
I2CInitialise | |
Initialsie the I2C module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BYTE | Baud |
0=100KHz, 1=400KHz, 2=1MHz | |
- VOID | Return |
IOGetInputPin | |
Sets the selected digital pin to an input and reads the input state. | |
- BYTE | Pin |
Range: 0-47 ... Pin 34 unimplemented | |
- BOOL | Return |
ADCSample8 | |
Reads the voltage present on an Analog pin as an 8-bit value range 0-255 | |
- BYTE | ADCChannel |
Range: 0-31 ... Channels 16-23 unimplemented | |
- BYTE | Return |
UARTCheckRX | |
Check to see if the UART module has received any data | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Return |
UARTInitialise | |
Initialise the UART module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- VOID | Return |
RegisterWrite | |
Writes to one of the registers on-board the device | |
- UINT | RegisterAddress |
The address of the register | |
- UINT | Data |
The data value to assign to the register | |
- VOID | Return |
RegisterRead | |
Read one of the registers on-board the device | |
- UINT | RegisterAddress |
The address of the register | |
- UINT | Return |
I2CRestart | |
Put the I2C Module into Restart mode | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- VOID | Return |
PWMDisable | |
Disable a PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- VOID | Return |
I2CStart | |
Put the I2C Module into Start mode | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- VOID | Return |
SPITransfer | |
Transfer a byte using the SPI bus | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- BYTE | DataOut |
- BYTE | Return |
I2CReceive | |
Receive a byte using the I2C bus | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BOOL | Last |
Last byte to receive: Range 0-1 | |
- BYTE | Return |
I2CStop | |
Put the I2C Module into Stop mode | |
- BYTE | Channel |
- VOID | Return |
ADCSetReferenceVoltage | |
Specified the reference setting for ADC reads. | |
- BYTE | RefType |
0=AREF, 1=VCC, 3=Internal 1.1V | |
- VOID | Return |
SPIPrescaler | |
Modify the speed of the SPI bus | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- BYTE | Prescaler |
Range: 0-2 | |
- VOID | Return |
ADCSample12 | |
Reads the voltage present on an Analog pin as an 12-bit value range 0-4095 | |
- BYTE | ADCChannel |
Range: 0-31 ... Channels 16-23 unimplemented | |
- UINT | Return |
PWMSetDuty | |
Sets the duty for the PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- BYTE | Duty |
- VOID | Return |
IOSetOutputPin | |
Sets the selected digital pin to an output and assigns the output state. | |
- BYTE | Pin |
Range: 0-47 ... Pin 34 unimplemented | |
- BOOL | State |
Range: 0-1 | |
- VOID | Return |
UARTReceive | |
Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Return |
SPIInitialise | |
Initialsie the SPI module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- VOID | Return |
I2CSend | |
Transmit a byte using the I2C bus | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BYTE | DataOut |
- BOOL | Return |
UARTSend | |
Send a byte via the UART module | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Data |
Data Byte to send. Range: 0-255 | |
- VOID | Return |
PWMSetPrescaler | |
Sets the prescaler for the PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- BYTE | Prescaler |
- BYTE | Period |
Default 255 | |
- VOID | Return |
PWMEnable | |
Enable a PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- VOID | Return |
Initialise | |
Initialise the comms to the Arduino board ready for commands to be sent. | |
- VOID | Return |
Property reference
==Macro reference==
I2CInitialise | |
Initialsie the I2C module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BYTE | Baud |
0=100KHz, 1=400KHz, 2=1MHz | |
- VOID | Return |
IOGetInputPin | |
Sets the selected digital pin to an input and reads the input state. | |
- BYTE | Pin |
Range: 0-47 ... Pin 34 unimplemented | |
- BOOL | Return |
ADCSample8 | |
Reads the voltage present on an Analog pin as an 8-bit value range 0-255 | |
- BYTE | ADCChannel |
Range: 0-31 ... Channels 16-23 unimplemented | |
- BYTE | Return |
UARTCheckRX | |
Check to see if the UART module has received any data | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Return |
UARTInitialise | |
Initialise the UART module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- VOID | Return |
RegisterWrite | |
Writes to one of the registers on-board the device | |
- UINT | RegisterAddress |
The address of the register | |
- UINT | Data |
The data value to assign to the register | |
- VOID | Return |
RegisterRead | |
Read one of the registers on-board the device | |
- UINT | RegisterAddress |
The address of the register | |
- UINT | Return |
I2CRestart | |
Put the I2C Module into Restart mode | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- VOID | Return |
PWMDisable | |
Disable a PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- VOID | Return |
I2CStart | |
Put the I2C Module into Start mode | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- VOID | Return |
SPITransfer | |
Transfer a byte using the SPI bus | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- BYTE | DataOut |
- BYTE | Return |
I2CReceive | |
Receive a byte using the I2C bus | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BOOL | Last |
Last byte to receive: Range 0-1 | |
- BYTE | Return |
I2CStop | |
Put the I2C Module into Stop mode | |
- BYTE | Channel |
- VOID | Return |
ADCSetReferenceVoltage | |
Specified the reference setting for ADC reads. | |
- BYTE | RefType |
0=AREF, 1=VCC, 3=Internal 1.1V | |
- VOID | Return |
SPIPrescaler | |
Modify the speed of the SPI bus | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- BYTE | Prescaler |
Range: 0-2 | |
- VOID | Return |
ADCSample12 | |
Reads the voltage present on an Analog pin as an 12-bit value range 0-4095 | |
- BYTE | ADCChannel |
Range: 0-31 ... Channels 16-23 unimplemented | |
- UINT | Return |
PWMSetDuty | |
Sets the duty for the PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- BYTE | Duty |
- VOID | Return |
IOSetOutputPin | |
Sets the selected digital pin to an output and assigns the output state. | |
- BYTE | Pin |
Range: 0-47 ... Pin 34 unimplemented | |
- BOOL | State |
Range: 0-1 | |
- VOID | Return |
UARTReceive | |
Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Return |
SPIInitialise | |
Initialsie the SPI module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- VOID | Return |
I2CSend | |
Transmit a byte using the I2C bus | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BYTE | DataOut |
- BOOL | Return |
UARTSend | |
Send a byte via the UART module | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Data |
Data Byte to send. Range: 0-255 | |
- VOID | Return |
PWMSetPrescaler | |
Sets the prescaler for the PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- BYTE | Prescaler |
- BYTE | Period |
Default 255 | |
- VOID | Return |
PWMEnable | |
Enable a PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- VOID | Return |
Initialise | |
Initialise the comms to the Arduino board ready for commands to be sent. | |
- VOID | Return |
Property reference
==Macro reference==
I2CInitialise | |
Initialsie the I2C module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BYTE | Baud |
0=100KHz, 1=400KHz, 2=1MHz | |
- VOID | Return |
IOGetInputPin | |
Sets the selected digital pin to an input and reads the input state. | |
- BYTE | Pin |
Range: 0-47 ... Pin 34 unimplemented | |
- BOOL | Return |
ADCSample8 | |
Reads the voltage present on an Analog pin as an 8-bit value range 0-255 | |
- BYTE | ADCChannel |
Range: 0-31 ... Channels 16-23 unimplemented | |
- BYTE | Return |
UARTCheckRX | |
Check to see if the UART module has received any data | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Return |
UARTInitialise | |
Initialise the UART module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- VOID | Return |
RegisterWrite | |
Writes to one of the registers on-board the device | |
- UINT | RegisterAddress |
The address of the register | |
- UINT | Data |
The data value to assign to the register | |
- VOID | Return |
RegisterRead | |
Read one of the registers on-board the device | |
- UINT | RegisterAddress |
The address of the register | |
- UINT | Return |
I2CRestart | |
Put the I2C Module into Restart mode | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- VOID | Return |
PWMDisable | |
Disable a PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- VOID | Return |
I2CStart | |
Put the I2C Module into Start mode | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- VOID | Return |
SPITransfer | |
Transfer a byte using the SPI bus | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- BYTE | DataOut |
- BYTE | Return |
I2CReceive | |
Receive a byte using the I2C bus | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BOOL | Last |
Last byte to receive: Range 0-1 | |
- BYTE | Return |
I2CStop | |
Put the I2C Module into Stop mode | |
- BYTE | Channel |
- VOID | Return |
ADCSetReferenceVoltage | |
Specified the reference setting for ADC reads. | |
- BYTE | RefType |
0=AREF, 1=VCC, 3=Internal 1.1V | |
- VOID | Return |
SPIPrescaler | |
Modify the speed of the SPI bus | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- BYTE | Prescaler |
Range: 0-2 | |
- VOID | Return |
ADCSample12 | |
Reads the voltage present on an Analog pin as an 12-bit value range 0-4095 | |
- BYTE | ADCChannel |
Range: 0-31 ... Channels 16-23 unimplemented | |
- UINT | Return |
PWMSetDuty | |
Sets the duty for the PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- BYTE | Duty |
- VOID | Return |
IOSetOutputPin | |
Sets the selected digital pin to an output and assigns the output state. | |
- BYTE | Pin |
Range: 0-47 ... Pin 34 unimplemented | |
- BOOL | State |
Range: 0-1 | |
- VOID | Return |
UARTReceive | |
Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Return |
SPIInitialise | |
Initialsie the SPI module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- VOID | Return |
I2CSend | |
Transmit a byte using the I2C bus | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BYTE | DataOut |
- BOOL | Return |
UARTSend | |
Send a byte via the UART module | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Data |
Data Byte to send. Range: 0-255 | |
- VOID | Return |
PWMSetPrescaler | |
Sets the prescaler for the PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- BYTE | Prescaler |
- BYTE | Period |
Default 255 | |
- VOID | Return |
PWMEnable | |
Enable a PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- VOID | Return |
Initialise | |
Initialise the comms to the Arduino board ready for commands to be sent. | |
- VOID | Return |
Property reference
==Macro reference==
I2CInitialise | |
Initialsie the I2C module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BYTE | Baud |
0=100KHz, 1=400KHz, 2=1MHz | |
- VOID | Return |
IOGetInputPin | |
Sets the selected digital pin to an input and reads the input state. | |
- BYTE | Pin |
Range: 0-47 ... Pin 34 unimplemented | |
- BOOL | Return |
ADCSample8 | |
Reads the voltage present on an Analog pin as an 8-bit value range 0-255 | |
- BYTE | ADCChannel |
Range: 0-31 ... Channels 16-23 unimplemented | |
- BYTE | Return |
UARTCheckRX | |
Check to see if the UART module has received any data | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Return |
UARTInitialise | |
Initialise the UART module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- VOID | Return |
RegisterWrite | |
Writes to one of the registers on-board the device | |
- UINT | RegisterAddress |
The address of the register | |
- UINT | Data |
The data value to assign to the register | |
- VOID | Return |
RegisterRead | |
Read one of the registers on-board the device | |
- UINT | RegisterAddress |
The address of the register | |
- UINT | Return |
I2CRestart | |
Put the I2C Module into Restart mode | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- VOID | Return |
PWMDisable | |
Disable a PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- VOID | Return |
I2CStart | |
Put the I2C Module into Start mode | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- VOID | Return |
SPITransfer | |
Transfer a byte using the SPI bus | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- BYTE | DataOut |
- BYTE | Return |
I2CReceive | |
Receive a byte using the I2C bus | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BOOL | Last |
Last byte to receive: Range 0-1 | |
- BYTE | Return |
I2CStop | |
Put the I2C Module into Stop mode | |
- BYTE | Channel |
- VOID | Return |
ADCSetReferenceVoltage | |
Specified the reference setting for ADC reads. | |
- BYTE | RefType |
0=AREF, 1=VCC, 3=Internal 1.1V | |
- VOID | Return |
SPIPrescaler | |
Modify the speed of the SPI bus | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- BYTE | Prescaler |
Range: 0-2 | |
- VOID | Return |
ADCSample12 | |
Reads the voltage present on an Analog pin as an 12-bit value range 0-4095 | |
- BYTE | ADCChannel |
Range: 0-31 ... Channels 16-23 unimplemented | |
- UINT | Return |
PWMSetDuty | |
Sets the duty for the PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- BYTE | Duty |
- VOID | Return |
IOSetOutputPin | |
Sets the selected digital pin to an output and assigns the output state. | |
- BYTE | Pin |
Range: 0-47 ... Pin 34 unimplemented | |
- BOOL | State |
Range: 0-1 | |
- VOID | Return |
UARTReceive | |
Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Return |
SPIInitialise | |
Initialsie the SPI module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- VOID | Return |
I2CSend | |
Transmit a byte using the I2C bus | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BYTE | DataOut |
- BOOL | Return |
UARTSend | |
Send a byte via the UART module | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Data |
Data Byte to send. Range: 0-255 | |
- VOID | Return |
PWMSetPrescaler | |
Sets the prescaler for the PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- BYTE | Prescaler |
- BYTE | Period |
Default 255 | |
- VOID | Return |
PWMEnable | |
Enable a PWM output | |
- BYTE | Channel |
Range: 0-15 | |
- VOID | Return |
Initialise | |
Initialise the comms to the Arduino board ready for commands to be sent. | |
- VOID | Return |