Difference between revisions of "Bot test"

From Flowcode Help
Jump to navigationJump to search
Line 2: Line 2:
 
|-
 
|-
 
| width="20%" style="color:gray;" | Author
 
| width="20%" style="color:gray;" | Author
| MatrixTSL
+
| Matrix Ltd.
 
|-
 
|-
 
| width="20%" style="color:gray;" | Version
 
| width="20%" style="color:gray;" | Version
| 2.0
+
| 1.4
 
|-
 
|-
 
| width="20%" style="color:gray;" | Category
 
| width="20%" style="color:gray;" | Category
| Comms: System
+
| Comms: Interface
 
|}
 
|}
  
  
==DMX-512 Master component==
+
==I2C Master component==
A serial based communications protocol designed for controlling theatrical equipment such as dimmers, fog machines and intelligent lights. DMX-512 Slave devices are daisy chained  together with a final 180R terminating resistor at the end of the chail. DMX requires the signal to be level shifted from VCC and GND to +2.5V and -2.5V.
+
Generic Two Wire I2C Communications Interface
 +
 
 +
==Detailed description==
 +
 
 +
 
  
 
==Examples==
 
==Examples==
  
 +
 +
More information on I2C can be found here,
 +
 +
[http://www.matrixtsl.com/blog/simplified-communications-i%c2%b2c-and-spi/ Matrix Flowcode Blog: Simplified communications I2C and SPI]
 +
 +
 +
===Generic I2C EEPROM===
 +
 +
Example file demonstrating how to read and write bytes from a generic I2C EEPROM device.
 +
{{Fcfile|I2CEEPROM.fcfx|I2CEEPROM}}
 +
===Simulated I2C devices===
 +
 +
This example uses the I2C master component combined with the DS1307 injector to simulate an I2C communications bus between the target Microcontroller and the virtual DS1307 device.
 +
{{Fcfile|DS1307InjectorTest.fcfx|I2C DS1307 Example}}
 +
The panel displays the current time from the DS1307 RAM which is populated to match the system time.
 +
 +
[[File:DS1307Panel.jpg]]
  
  
DMX Master Example, reads the value of two ports using switch arrays to set the values and then transmits the data in a DMX packet.
+
The I2C console shows the communications between the target microcontroller and simulated I2C device.
  
{{Fcfile|DMX_Master_Example1.fcfx|DMX Master Example1}}
+
[[File:DS1307Data.jpg]]
  
  
DMX Slave Example, captures the first DMX data channel sent from the Master and outputs the value onto a Port using the LED array component.
+
The DS1307 console shows the contents of RAM memory on the simulated I2C device.
  
{{Fcfile|DMX_Slave_Example1.fcfx|DMX Slave Example1}}
+
[[File:DS1307Ram.jpg]]
  
  
Line 35: Line 56:
 
|-
 
|-
 
| 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;" | '''SetDataChannel'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveByte'''
 +
|-
 +
| colspan="2" | Receives a byte from the I²C bus.  
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Last
 +
|-
 +
| colspan="2" | Used to signify the last byte when streaming incoming data. 0=Not last byte, 1=Last Byte 
 +
|-
 +
| 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;" | '''Restart'''
 +
|-
 +
| colspan="2" | Outputs a restart condition onto the I²C bus. 
 +
|-
 +
|-
 +
| 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;" | '''Stop'''
 +
|-
 +
| colspan="2" | Outputs a stop condition onto the I²C bus. 
 +
|-
 +
|-
 +
| 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;" | '''Transaction_Write'''
 
|-
 
|-
| colspan="2" | Sets the data byte in a data channel 
+
| colspan="2" | Attempt to write Length number of bytes to the I2C slave from the given Buffer. Ensure that the Buffer is large enough.  Returns the number of bytes written, the caller should check that this matches requested Length 
 
|-
 
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Buffer
 +
|-
 +
| colspan="2" | Buffer of bytes to write to the I2C 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Channel
+
| width="90%" | Length
 +
|-
 +
| 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;" | '''TransmitByte'''
 +
|-
 +
| colspan="2" | Sends a byte on the I²C bus. Returns the acknowledge if any.  0 represents that data was acknowledged and 1 represents no acknowledge was detected. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Data byte to send on the I²C bus. 
 +
|-
 +
| 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;" | '''GenericWriteRegister'''
 +
|-
 +
| colspan="2" | Function to perform a generic I2C Write transaction. The 7-bit device ID is automatically shifted up by one bit to make room for the read/write bit. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Device_ID
 +
|-
 +
| colspan="2" | 7-bit Device Address ID 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Address
 
|-
 
|-
 
| colspan="2" |  
 
| colspan="2" |  
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | DataValue
+
| width="90%" | Data
 +
|-
 +
| colspan="2" | Data Byte 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | AddressByteCount
 +
|-
 +
| colspan="2" | Specifies the number of address bytes, Range: 1 or 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;" | '''Transaction_Uninit'''
 +
|-
 +
| colspan="2" | Uninitialise the I2C interface 
 
|-
 
|-
| colspan="2" |  
 
 
|-
 
|-
 
| 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 58: Line 187:
 
|-
 
|-
 
| 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;" | '''SendDataChain'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GenericReadRegister'''
 
|-
 
|-
| colspan="2" | Transmits the BREAK, MAB and StartCode followed by the contents of the data channels. 
+
| colspan="2" | Function to perform a generic I2C read.  The 7-bit device ID is automatically shifted up by one bit to make room for the read/write bit. Returns the data from the location specified. 
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | StartCode
+
| width="90%" | Device_ID
 +
|-
 +
| colspan="2" | 7-bit Device Address ID 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Address
 
|-
 
|-
 
| colspan="2" |  
 
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | AddressByteCount
 +
|-
 +
| colspan="2" | Specifies the number of address bytes, Range: 1 or 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;" | '''Transaction_Read'''
 +
|-
 +
| colspan="2" | Attempt to read Length number of bytes from the I2C slave to the given Buffer. Ensure that the Buffer is large enough.  Returns number of bytes read, caller should check that this matches requested Length 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Buffer
 +
|-
 +
| colspan="2" | Buffer to store the incoming byte data 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Length
 +
|-
 +
| colspan="2" | Number of bytes to read 
 +
|-
 +
| 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;" | '''Start'''
 +
|-
 +
| colspan="2" | Outputs a start condition onto the I²C bus. 
 +
|-
 
|-
 
|-
 
| 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''
 +
|}
 +
 +
 +
{| 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;" | '''Transaction_Initialise'''
 +
|-
 +
| colspan="2" | Initialise the I2C interface to communicate with a Slave device at Address Returns 0 on fail, 1 on success 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Address
 +
|-
 +
| colspan="2" | 7-bit I2C Address without the shift for the R/W bit 
 +
|-
 +
| 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''
 
|}
 
|}
Line 78: Line 271:
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
|-
| colspan="2" | Configures the UART serial interface. 
+
| colspan="2" | Enables the I²C hardware and performs some initialization. Should be called at the start of the program or at least before any of the other I²C functions are called. 
 
|-
 
|-
 
|-
 
|-
Line 99: Line 292:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | UART Channel selector Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. Hardware channels use the selected peripheral on-board the target microcontroller. 
+
| colspan="2" | Channel selection 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Baud Options
+
| width="90%" | Baud Select
 
|-
 
|-
 
| colspan="2" | Baud rate option selector 
 
| colspan="2" | Baud rate option selector 
Line 109: Line 302:
 
| width="90%" | Baud Rate
 
| width="90%" | Baud Rate
 
|-
 
|-
| colspan="2" |  
+
| colspan="2" | Baud rate to be used 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 +
| width="90%" | Stop Delay
 +
|-
 +
| colspan="2" | On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not  a 10ms delay between an I2C stop event and the next I2C start event.  Most modern microcontrollers will not have a problem so this property can be disabled to speed up the  I2C communications.  
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | TX
+
| width="90%" | Slew Rate Control
 
|-
 
|-
| colspan="2" | Pin to be used for Transmit data 
+
| colspan="2" | Slew Rate Control Enabled or Disabled 
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Data Channels
+
| width="90%" | SMBus Inputs
 
|-
 
|-
| colspan="2" | Number of data bytes used by the DMX chain, Max 512 bytes per transmission. 24 Bytes minimum to match minimum 1204us timing requirements, not all channels need to be used. 
+
| colspan="2" | When Enabled input logic thresholds are compliant with SMBus specification 
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''  
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''  
 
|-
 
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | SDA
 +
|-
 +
| colspan="2" | Pin used for SDA (data signal) 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | SCL
 +
|-
 +
| colspan="2" | Pin used for SCL (clock signal) 
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''  
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''  
 
|-
 
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 +
| width="90%" | Label
 +
|-
 +
| colspan="2" | Label shown on the comms flasher on the simulation panel. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Scope Traces
 
| width="90%" | Scope Traces
 
|-
 
|-
| colspan="2" | Selects if the scope traces are automatically added to the data recorder window or not.    Simulation - draws an approximation of the UART data onto the scope trace.    ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD. 
+
| colspan="2" | Selects if the scope traces are automatically generated or not 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
Line 138: Line 351:
 
|-
 
|-
 
| colspan="2" | Selects if the console data is automatically generated or not 
 
| colspan="2" | Selects if the console data is automatically generated or not 
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | Console Columns
 
|-
 
| colspan="2" | Number of characters that can be displayed on a single line of the console. 
 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Data Source
+
| width="90%" | API
 
|-
 
|-
| colspan="2" | Simulation data source used to allow the component to connect to various remote devices    Nothing - Simulation data is ignored    COM port - Routes the communication data to and from a physical or virtual COM port      Injector - Routes the communication data via a data injector component on the Panel. 
+
| colspan="2" |  
 
|}
 
|}

Revision as of 13:20, 31 August 2021

Author Matrix Ltd.
Version 1.4
Category Comms: Interface


I2C Master component

Generic Two Wire I2C Communications Interface

Detailed description

Examples

More information on I2C can be found here,

Matrix Flowcode Blog: Simplified communications I2C and SPI


Generic I2C EEPROM

Example file demonstrating how to read and write bytes from a generic I2C EEPROM device. FC6 Icon.png I2CEEPROM

Simulated I2C devices

This example uses the I2C master component combined with the DS1307 injector to simulate an I2C communications bus between the target Microcontroller and the virtual DS1307 device. FC6 Icon.png I2C DS1307 Example The panel displays the current time from the DS1307 RAM which is populated to match the system time.

DS1307Panel.jpg


The I2C console shows the communications between the target microcontroller and simulated I2C device.

DS1307Data.jpg


The DS1307 console shows the contents of RAM memory on the simulated I2C device.

DS1307Ram.jpg


Downloadable macro reference

Fc9-comp-macro.png ReceiveByte
Receives a byte from the I²C bus.  
Fc9-u8-icon.png - BYTE Last
Used to signify the last byte when streaming incoming data. 0=Not last byte, 1=Last Byte 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Restart
Outputs a restart condition onto the I²C bus. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Stop
Outputs a stop condition onto the I²C bus. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Transaction_Write
Attempt to write Length number of bytes to the I2C slave from the given Buffer. Ensure that the Buffer is large enough. Returns the number of bytes written, the caller should check that this matches requested Length 
Fc9-u8-icon.png - BYTE Buffer
Buffer of bytes to write to the I2C 
Fc9-u16-icon.png - UINT Length
Number of bytes to send out, MS bit 0x8000 signifies no Stop if set 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png TransmitByte
Sends a byte on the I²C bus. Returns the acknowledge if any. 0 represents that data was acknowledged and 1 represents no acknowledge was detected. 
Fc9-u8-icon.png - BYTE Data
Data byte to send on the I²C bus. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GenericWriteRegister
Function to perform a generic I2C Write transaction. The 7-bit device ID is automatically shifted up by one bit to make room for the read/write bit. 
Fc9-u8-icon.png - BYTE Device_ID
7-bit Device Address ID 
Fc9-u16-icon.png - UINT Address
 
Fc9-u8-icon.png - BYTE Data
Data Byte 
Fc9-u8-icon.png - BYTE AddressByteCount
Specifies the number of address bytes, Range: 1 or 2 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Transaction_Uninit
Uninitialise the I2C interface 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GenericReadRegister
Function to perform a generic I2C read. The 7-bit device ID is automatically shifted up by one bit to make room for the read/write bit. Returns the data from the location specified. 
Fc9-u8-icon.png - BYTE Device_ID
7-bit Device Address ID 
Fc9-u16-icon.png - UINT Address
 
Fc9-u8-icon.png - BYTE AddressByteCount
Specifies the number of address bytes, Range: 1 or 2 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Transaction_Read
Attempt to read Length number of bytes from the I2C slave to the given Buffer. Ensure that the Buffer is large enough. Returns number of bytes read, caller should check that this matches requested Length 
Fc9-u8-icon.png - BYTE Buffer
Buffer to store the incoming byte data 
Fc9-u16-icon.png - UINT Length
Number of bytes to read 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png Start
Outputs a start condition onto the I²C bus. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Transaction_Initialise
Initialise the I2C interface to communicate with a Slave device at Address Returns 0 on fail, 1 on success 
Fc9-u8-icon.png - BYTE Address
7-bit I2C Address without the shift for the R/W bit 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Initialise
Enables the I²C hardware and performs some initialization. Should be called at the start of the program or at least before any of the other I²C functions are called. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-type-16-icon.png Slew Rate Control
Slew Rate Control Enabled or Disabled 
Fc9-type-16-icon.png SMBus Inputs
When Enabled input logic thresholds are compliant with SMBus specification 
Fc9-conn-icon.png Connections
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-conn-icon.png Simulations
Fc9-type-10-icon.png Label
Label shown on the comms flasher on the simulation panel. 
Fc9-type-7-icon.png Scope Traces
Selects if the scope traces are automatically generated or not 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-16-icon.png API