Difference between revisions of "Component: I2C (CAL) (Misc)"
(One intermediate revision by one other user not shown) | |||
Line 15: | Line 15: | ||
CAL = Code Abstraction Layer - Allows one code base to run on a wide range of chips. A low level implementation giving direct access to the Two Wire I²C peripheral. | CAL = Code Abstraction Layer - Allows one code base to run on a wide range of chips. A low level implementation giving direct access to the Two Wire I²C peripheral. | ||
− | == | + | ==Detailed description== |
+ | |||
+ | |||
+ | |||
− | |||
− | |||
− | |||
Line 27: | Line 27: | ||
+ | ''No detailed description exists yet for this component'' | ||
+ | |||
+ | ==Examples== | ||
Line 33: | Line 36: | ||
− | |||
− | |||
Line 47: | Line 48: | ||
− | |||
Line 54: | Line 54: | ||
+ | ===PIC16F1937 Examples=== | ||
+ | The slave device is connected to a bank of switches, the master device to a bank of LEDs. The value of the switches is passed to the master LEDs. | ||
+ | {{Fcfile|1. I2C Master Read.fcfx|Master Read Example}} | ||
+ | {{Fcfile|1. I2C Slave switches.fcfx|Slave Switches Example}} | ||
+ | The slave device is connected to a bank of LEDs, the master device to a bank of switches. The value of the switches is passed to the slave LEDs. | ||
+ | {{Fcfile|2. I2C Master Switches.fcfx|Master Send Example}} | ||
+ | {{Fcfile|2. I2C Slave LEDs.fcfx|Slave LEDs Example}} | ||
+ | ===Arduino Uno Examples=== | ||
+ | Example program showing how to use the I2C Slave on an AVR Arduino device. | ||
+ | {{Fcfile|I2C Uno slave.fcfx|I2C Slave Arduino Uno Example}} | ||
+ | ===ECIO40P Examples=== | ||
+ | Example program showing how to use the I2C Slave on an ECIO40P device. | ||
+ | {{Fcfile|ECIO40P_I2C_Master.fcfx|Master Example}} | ||
+ | {{Fcfile|ECIO40P_I2C_Slave.fcfx|Slave Example}} | ||
Line 505: | Line 519: | ||
| colspan="2" | Specifies the API component on the panel to interact with to provide comms simulation. | | colspan="2" | Specifies the API component on the panel to interact with to provide comms simulation. | ||
|} | |} | ||
+ | |||
+ | ==Component Source Code== | ||
+ | |||
+ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_I2C.fcfx FC_Comp_Source_I2C.fcfx] | ||
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_I2C.fcfx FC_Comp_Source_I2C.fcfx] |
Latest revision as of 12:24, 23 February 2024
Author | Matrix TSL |
Version | 2.0 |
Category | Misc |
Contents
- 1 I2C component
- 2 Detailed description
- 3 Examples
- 4 Macro reference
- 4.1 GetConsoleHandle
- 4.2 GetList
- 4.3 GetValue
- 4.4 Master_Init
- 4.5 Master_Restart
- 4.6 Master_RxByte
- 4.7 Master_Start
- 4.8 Master_Stop
- 4.9 Master_TxByte
- 4.10 Master_Uninit
- 4.11 SetValue
- 4.12 Slave_Init
- 4.13 Slave_RxByte
- 4.14 Slave_Status
- 4.15 Slave_TxByte
- 4.16 Slave_Uninit
- 4.17 Transaction_Initialise
- 4.18 Transaction_Read
- 4.19 Transaction_Uninit
- 4.20 Transaction_Write
- 5 Property reference
- 6 Component Source Code
I2C component
CAL = Code Abstraction Layer - Allows one code base to run on a wide range of chips. A low level implementation giving direct access to the Two Wire I²C peripheral.
Detailed description
No detailed description exists yet for this component
Examples
PIC16F1937 Examples
The slave device is connected to a bank of switches, the master device to a bank of LEDs. The value of the switches is passed to the master LEDs.
Master Read Example
Slave Switches Example
The slave device is connected to a bank of LEDs, the master device to a bank of switches. The value of the switches is passed to the slave LEDs.
Master Send Example
Arduino Uno Examples
Example program showing how to use the I2C Slave on an AVR Arduino device.
I2C Slave Arduino Uno Example
ECIO40P Examples
Example program showing how to use the I2C Slave on an ECIO40P device.
Master Example
Macro reference
GetConsoleHandle
![]() |
GetConsoleHandle |
Obtains the CAL console handle | |
![]() |
Return |
GetList
![]() |
GetList |
returns Named property List as filter string | |
![]() |
Name |
![]() |
Return |
GetValue
![]() |
GetValue |
Get the Named property value. | |
![]() |
Name |
![]() |
Return |
Master_Init
![]() |
Master_Init |
Initialise the Master | |
![]() |
Return |
Master_Restart
![]() |
Master_Restart |
Output a Master Restart sequence | |
![]() |
Return |
Master_RxByte
Master_Start
![]() |
Master_Start |
Output a Master Start sequence | |
![]() |
Return |
Master_Stop
![]() |
Master_Stop |
Output a Master Stop | |
![]() |
Return |
Master_TxByte
Master_Uninit
![]() |
Master_Uninit |
Uninitialise the Master | |
![]() |
Return |
SetValue
![]() |
SetValue |
Change Named property to new Value. If "CHANNEL" the ports will be also updated from the fcd | |
![]() |
Name |
![]() |
Value |
port value as string | |
![]() |
Return |
Slave_Init
Slave_RxByte
![]() |
Slave_RxByte |
Returns the data received, and sends either Ack or Nak Set parameter Last as: 1=Last=Nak, 0=Ack=More | |
![]() |
Last |
Sends Ack if 0, else Nak | |
![]() |
Return |
Slave_Status
Slave_TxByte
![]() |
Slave_TxByte |
Send a data byte, returns Ack/Nak from Master 0=Ack=More, 1=Nak=Last | |
![]() |
Data |
![]() |
Return |
Slave_Uninit
![]() |
Slave_Uninit |
Uninitialise the Slave | |
![]() |
Return |
Transaction_Initialise
Transaction_Read
Transaction_Uninit
![]() |
Transaction_Uninit |
Uninitialise the I2C interface | |
![]() |
Return |
Transaction_Write
Property reference
Component Source Code
Please click here to download the component source project: FC_Comp_Source_I2C.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_I2C.fcfx