Using Boost-C I2C commands in Flowcode
Posted: Mon Mar 19, 2007 11:42 am
Hi,
The I2C BoostC commands appear to be as follows :
void i2c_START(void) // Generates the I2C Bus Start Condition
void i2c_RESTART(void) // Generates the I2C Bus Restart Condition
void i2c_STOP(void) // Generates the I2C Bus Stop Condition
unsigned char i2c_WRITE(unsigned char i2c_data) // Generates the I2C Bus Write Condition
unsigned char i2c_READ(char ack_status) // Generates the I2C Bus Read Condition
void i2c_INIT(unsigned char i2c_divisor) // Generates the I2C Bus Initialization
these can presumably be used to generate a read and write along the lines of :
// Read from the External EEPROM
i2c_start();
i2c_write(HW_address); // send XEE i2c address
i2c_write(i2c_addr >> 8 ) ; // send XEE internal HIGH address
i2c_write((char) i2c_addr & 0x00ff); // send XEE internal LOW address
i2c_restart(); // send i2c_restart
// Write to the External EEPROM
i2c_start();
i2c_write(HW_address); // send XEE i2c address
i2c_write(i2c_addr >> 8 ) ; // send XEE internal HIGH address
i2c_write((char) i2c_addr & 0x00ff); // send XEE internal LOW address
However, after incorporating the command
#include <i2c_driver.h>
in the supplemantary code section of Flowcode I cannot get Flowcode to compile a C code icon containing any of these commands, e.g.
i2c_start();
in a C code icon is not recognised.
Please give me a starter in implementing the commands in Flowcode.
Thanks,
Mark
The I2C BoostC commands appear to be as follows :
void i2c_START(void) // Generates the I2C Bus Start Condition
void i2c_RESTART(void) // Generates the I2C Bus Restart Condition
void i2c_STOP(void) // Generates the I2C Bus Stop Condition
unsigned char i2c_WRITE(unsigned char i2c_data) // Generates the I2C Bus Write Condition
unsigned char i2c_READ(char ack_status) // Generates the I2C Bus Read Condition
void i2c_INIT(unsigned char i2c_divisor) // Generates the I2C Bus Initialization
these can presumably be used to generate a read and write along the lines of :
// Read from the External EEPROM
i2c_start();
i2c_write(HW_address); // send XEE i2c address
i2c_write(i2c_addr >> 8 ) ; // send XEE internal HIGH address
i2c_write((char) i2c_addr & 0x00ff); // send XEE internal LOW address
i2c_restart(); // send i2c_restart
// Write to the External EEPROM
i2c_start();
i2c_write(HW_address); // send XEE i2c address
i2c_write(i2c_addr >> 8 ) ; // send XEE internal HIGH address
i2c_write((char) i2c_addr & 0x00ff); // send XEE internal LOW address
However, after incorporating the command
#include <i2c_driver.h>
in the supplemantary code section of Flowcode I cannot get Flowcode to compile a C code icon containing any of these commands, e.g.
i2c_start();
in a C code icon is not recognised.
Please give me a starter in implementing the commands in Flowcode.
Thanks,
Mark