diff --git a/html/FreeSans.ttf b/html/FreeSans.ttf new file mode 100644 index 0000000..b550b90 Binary files /dev/null and b/html/FreeSans.ttf differ diff --git a/html/attribute.html b/html/attribute.html new file mode 100644 index 0000000..adbdbf1 --- /dev/null +++ b/html/attribute.html @@ -0,0 +1,68 @@ + + +
+ + + + +
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
arduino master i2c in plain c code +More...
+#include "ci2c.h"
+Macros | |
#define | START 0x08 |
#define | REPEATED_START 0x10 |
#define | MT_SLA_ACK 0x18 |
#define | MT_SLA_NACK 0x20 |
#define | MT_DATA_ACK 0x28 |
#define | MT_DATA_NACK 0x30 |
#define | MR_SLA_ACK 0x40 |
#define | MR_SLA_NACK 0x48 |
#define | MR_DATA_ACK 0x50 |
#define | MR_DATA_NACK 0x58 |
#define | LOST_ARBTRTN 0x38 |
#define | TWI_STATUS (TWSR & 0xF8) |
#define | setRegBit(r, b) r |= (1 << b) |
set bit b in register r More... | |
#define | clrRegBit(r, b) r &= (uint8_t) (~(1 << b)) |
clear bit b in register r More... | |
#define | invRegBit(r, b) r ^= (1 << b) |
invert bit b in register r More... | |
+Functions | |
void | I2C_slave_init (I2C_SLAVE *slave, const uint8_t sl_addr, const I2C_INT_SIZE reg_sz) |
Init an I2C slave structure for cMI2C communication. More... | |
void | I2C_slave_set_rw_func (I2C_SLAVE *slave, const ci2c_fct_ptr func, const I2C_RW rw) |
Redirect slave I2C read/write function (if needed for advanced use) More... | |
bool | I2C_slave_set_addr (I2C_SLAVE *slave, const uint8_t sl_addr) |
Change I2C slave address. More... | |
bool | I2C_slave_set_reg_size (I2C_SLAVE *slave, const I2C_INT_SIZE reg_sz) |
Change I2C registers map size (for access) More... | |
void | I2C_init (const uint16_t speed) |
Enable I2c module on arduino board (including pull-ups, enabling of ACK, and setting clock frequency) More... | |
void | I2C_uninit () |
Disable I2c module on arduino board (releasing pull-ups, and TWI control) More... | |
void | I2C_reset (void) |
I2C bus reset (Release SCL and SDA lines and re-enable module) More... | |
uint16_t | I2C_set_speed (const uint16_t speed) |
Change I2C frequency. More... | |
uint16_t | I2C_set_timeout (const uint16_t timeout) |
Change I2C ack timeout. More... | |
uint8_t | I2C_set_retries (const uint8_t retries) |
Change I2C message retries (in case of failure) More... | |
bool | I2C_is_busy (void) |
Get I2C busy status. More... | |
I2C_STATUS | I2C_write (I2C_SLAVE *slave, const uint16_t reg_addr, uint8_t *data, const uint16_t bytes) |
This function writes the provided data to the address specified. More... | |
I2C_STATUS | I2C_read (I2C_SLAVE *slave, const uint16_t reg_addr, uint8_t *data, const uint16_t bytes) |
This function reads data from the address specified and stores this data in the area provided by the pointer. More... | |
bool | I2C_start (void) |
Send start condition. More... | |
bool | I2C_stop (void) |
Send stop condition. More... | |
bool | I2C_wr8 (const uint8_t dat) |
Send byte on bus. More... | |
uint8_t | I2C_rd8 (const bool ack) |
Receive byte from bus. More... | |
bool | I2C_sndAddr (I2C_SLAVE *slave, const I2C_RW rw) |
Send I2C address. More... | |
arduino master i2c in plain c code
+ +#define clrRegBit | +( | ++ | r, | +
+ | + | + | b | +
+ | ) | +r &= (uint8_t) (~(1 << b)) | +
clear bit b in register r
+ +#define invRegBit | +( | ++ | r, | +
+ | + | + | b | +
+ | ) | +r ^= (1 << b) | +
invert bit b in register r
+ +#define LOST_ARBTRTN 0x38 | +
#define MR_DATA_ACK 0x50 | +
#define MR_DATA_NACK 0x58 | +
#define MR_SLA_ACK 0x40 | +
#define MR_SLA_NACK 0x48 | +
#define MT_DATA_ACK 0x28 | +
#define MT_DATA_NACK 0x30 | +
#define MT_SLA_ACK 0x18 | +
#define MT_SLA_NACK 0x20 | +
#define REPEATED_START 0x10 | +
#define setRegBit | +( | ++ | r, | +
+ | + | + | b | +
+ | ) | +r |= (1 << b) | +
set bit b in register r
+ +#define START 0x08 | +
#define TWI_STATUS (TWSR & 0xF8) | +
void I2C_init | +( | +const uint16_t | +speed | ) | ++ |
Enable I2c module on arduino board (including pull-ups, enabling of ACK, and setting clock frequency)
+[in] | speed | - I2C bus speed in KHz |
bool I2C_is_busy | +( | +void | +) | ++ |
Get I2C busy status.
+uint8_t I2C_rd8 | +( | +const bool | +ack | ) | ++ |
Receive byte from bus.
+[in] | ack | - true if wait for ack |
I2C_STATUS I2C_read | +( | +I2C_SLAVE * | +slave, | +
+ | + | const uint16_t | +reg_addr, | +
+ | + | uint8_t * | +data, | +
+ | + | const uint16_t | +bytes | +
+ | ) | ++ |
This function reads data from the address specified and stores this data in the area provided by the pointer.
+[in,out] | slave | - pointer to the I2C slave structure |
[in] | reg_addr | - register address in register map |
[in,out] | data | - pointer to the first byte of a block of data to read |
[in] | bytes | - indicates how many bytes of data to read |
void I2C_reset | +( | +void | +) | ++ |
I2C bus reset (Release SCL and SDA lines and re-enable module)
+uint8_t I2C_set_retries | +( | +const uint8_t | +retries | ) | ++ |
Change I2C message retries (in case of failure)
+[in] | retries | - I2C number of retries (max of 8) |
uint16_t I2C_set_speed | +( | +const uint16_t | +speed | ) | ++ |
Change I2C frequency.
+[in] | speed | - I2C speed in KHz (max 400KHz on avr) |
uint16_t I2C_set_timeout | +( | +const uint16_t | +timeout | ) | ++ |
Change I2C ack timeout.
+[in] | timeout | - I2C ack timeout (500 ms max) |
void I2C_slave_init | +( | +I2C_SLAVE * | +slave, | +
+ | + | const uint8_t | +sl_addr, | +
+ | + | const I2C_INT_SIZE | +reg_sz | +
+ | ) | ++ |
Init an I2C slave structure for cMI2C communication.
+[in] | slave | - pointer to the I2C slave structure to init |
[in] | sl_addr | - I2C slave address |
[in] | reg_sz | - internal register map size |
bool I2C_slave_set_addr | +( | +I2C_SLAVE * | +slave, | +
+ | + | const uint8_t | +sl_addr | +
+ | ) | ++ |
Change I2C slave address.
+[in,out] | slave | - pointer to the I2C slave structure to init |
[in] | sl_addr | - I2C slave address |
bool I2C_slave_set_reg_size | +( | +I2C_SLAVE * | +slave, | +
+ | + | const I2C_INT_SIZE | +reg_sz | +
+ | ) | ++ |
Change I2C registers map size (for access)
+[in,out] | slave | - pointer to the I2C slave structure |
[in] | reg_sz | - internal register map size |
void I2C_slave_set_rw_func | +( | +I2C_SLAVE * | +slave, | +
+ | + | const ci2c_fct_ptr | +func, | +
+ | + | const I2C_RW | +rw | +
+ | ) | ++ |
Redirect slave I2C read/write function (if needed for advanced use)
+[in] | slave | - pointer to the I2C slave structure to init |
[in] | func | - pointer to read/write function to affect |
[in] | rw | - 0 = write function, 1 = read function |
Send I2C address.
+[in] | slave | - pointer to the I2C slave structure |
[in] | rw | - read/write transaction |
bool I2C_start | +( | +void | +) | ++ |
Send start condition.
+bool I2C_stop | +( | +void | +) | ++ |
Send stop condition.
+void I2C_uninit | +( | +) | ++ |
Disable I2c module on arduino board (releasing pull-ups, and TWI control)
+bool I2C_wr8 | +( | +const uint8_t | +dat | ) | ++ |
Send byte on bus.
+[in] | dat | - data to be sent |
I2C_STATUS I2C_write | +( | +I2C_SLAVE * | +slave, | +
+ | + | const uint16_t | +reg_addr, | +
+ | + | uint8_t * | +data, | +
+ | + | const uint16_t | +bytes | +
+ | ) | ++ |
This function writes the provided data to the address specified.
+[in,out] | slave | - pointer to the I2C slave structure |
[in] | reg_addr | - register address in register map |
[in] | data | - pointer to the first byte of a block of data to write |
[in] | bytes | - indicates how many bytes of data to write |
bool busy | +
true if already busy (in case of interrupts implementation)
+ +struct { ... } cfg | +
uint8_t retries | +
i2c message retries when fail
+ +uint16_t start_wait | +
time start waiting for acknowledge
+ +uint16_t timeout | +
i2c timeout (ms)
+ +
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
arduino i2c in plain c declarations +More...
+#include <Arduino.h>
#include <inttypes.h>
#include <stdbool.h>
Go to the source code of this file.
++Data Structures | |
struct | StructI2CSlave |
ci2c slave config and control parameters More... | |
+Macros | |
#define | __attribute__(a) |
GCC attribute (ignored by Doxygen) More... | |
#define | DEF_CI2C_NB_RETRIES 3 |
Default cI2C transaction retries. More... | |
#define | DEF_CI2C_TIMEOUT 100 |
Default cI2C timeout. More... | |
+Typedefs | |
typedef enum enI2C_RW | I2C_RW |
typedef enum enI2C_SPEED | I2C_SPEED |
typedef enum enI2C_STATUS | I2C_STATUS |
typedef enum enI2C_INT_SIZE | I2C_INT_SIZE |
typedef bool(* | ci2c_fct_ptr) (void *, const uint16_t, uint8_t *, const uint16_t) |
i2c read/write function pointer typedef More... | |
typedef struct StructI2CSlave | I2C_SLAVE |
+Enumerations | |
enum | enI2C_RW { I2C_WRITE = 0, +I2C_READ + } |
I2C RW bit enumeration. More... | |
enum | enI2C_SPEED { I2C_STD = 100, +I2C_FM = 400, +I2C_FMP = 1000, +I2C_HS = 3400 + } |
I2C bus speed. More... | |
enum | enI2C_STATUS { I2C_OK = 0x00, +I2C_BUSY, +I2C_NACK + } |
I2C slave status. More... | |
enum | enI2C_INT_SIZE { I2C_NO_REG = 0x00, +I2C_8B_REG, +I2C_16B_REG + } |
I2C slave internal address registers size. More... | |
+Functions | |
void | I2C_slave_init (I2C_SLAVE *slave, const uint8_t sl_addr, const I2C_INT_SIZE reg_sz) |
Init an I2C slave structure for cMI2C communication. More... | |
void | I2C_slave_set_rw_func (I2C_SLAVE *slave, const ci2c_fct_ptr func, const I2C_RW rw) |
Redirect slave I2C read/write function (if needed for advanced use) More... | |
bool | I2C_slave_set_addr (I2C_SLAVE *slave, const uint8_t sl_addr) |
Change I2C slave address. More... | |
bool | I2C_slave_set_reg_size (I2C_SLAVE *slave, const I2C_INT_SIZE reg_sz) |
Change I2C registers map size (for access) More... | |
uint8_t | I2C_slave_get_addr (const I2C_SLAVE *slave) |
Get I2C slave address. More... | |
bool | I2C_slave_get_reg_size (const I2C_SLAVE *slave) |
Get I2C register map size (for access) More... | |
uint16_t | I2C_slave_get_reg_addr (const I2C_SLAVE *slave) |
Get I2C current register address (addr may passed this way in procedures if contigous accesses) More... | |
void | I2C_init (const uint16_t speed) |
Enable I2c module on arduino board (including pull-ups, enabling of ACK, and setting clock frequency) More... | |
void | I2C_uninit () |
Disable I2c module on arduino board (releasing pull-ups, and TWI control) More... | |
uint16_t | I2C_set_speed (const uint16_t speed) |
Change I2C frequency. More... | |
uint16_t | I2C_set_timeout (const uint16_t timeout) |
Change I2C ack timeout. More... | |
uint8_t | I2C_set_retries (const uint8_t retries) |
Change I2C message retries (in case of failure) More... | |
bool | I2C_is_busy (void) |
Get I2C busy status. More... | |
I2C_STATUS | I2C_write (I2C_SLAVE *slave, const uint16_t reg_addr, uint8_t *data, const uint16_t bytes) |
This function writes the provided data to the address specified. More... | |
I2C_STATUS | I2C_write_next (I2C_SLAVE *slave, uint8_t *data, const uint16_t bytes) |
This inline is a wrapper to I2C_write in case of contigous operations. More... | |
I2C_STATUS | I2C_read (I2C_SLAVE *slave, const uint16_t reg_addr, uint8_t *data, const uint16_t bytes) |
This function reads data from the address specified and stores this data in the area provided by the pointer. More... | |
I2C_STATUS | I2C_read_next (I2C_SLAVE *slave, uint8_t *data, const uint16_t bytes) |
This inline is a wrapper to I2C_read in case of contigous operations. More... | |
void | I2C_reset (void) |
I2C bus reset (Release SCL and SDA lines and re-enable module) More... | |
bool | I2C_start (void) |
Send start condition. More... | |
bool | I2C_stop (void) |
Send stop condition. More... | |
bool | I2C_wr8 (const uint8_t dat) |
Send byte on bus. More... | |
uint8_t | I2C_rd8 (const bool ack) |
Receive byte from bus. More... | |
bool | I2C_sndAddr (I2C_SLAVE *slave, const I2C_RW rw) |
Send I2C address. More... | |
arduino i2c in plain c declarations
+ +#define __attribute__ | +( | ++ | a | ) | ++ |
GCC attribute (ignored by Doxygen)
+ +#define DEF_CI2C_NB_RETRIES 3 | +
Default cI2C transaction retries.
+ +#define DEF_CI2C_TIMEOUT 100 | +
Default cI2C timeout.
+ +typedef bool(* ci2c_fct_ptr) (void *, const uint16_t, uint8_t *, const uint16_t) | +
i2c read/write function pointer typedef
+ +typedef enum enI2C_INT_SIZE I2C_INT_SIZE | +
typedef struct StructI2CSlave I2C_SLAVE | +
typedef enum enI2C_SPEED I2C_SPEED | +
typedef enum enI2C_STATUS I2C_STATUS | +
enum enI2C_INT_SIZE | +
I2C slave internal address registers size.
+enum enI2C_RW | +
I2C RW bit enumeration.
+Enumerator | |
---|---|
I2C_WRITE | I2C rw bit (write) + |
I2C_READ | I2C rw bit (read) + |
enum enI2C_SPEED | +
I2C bus speed.
+enum enI2C_STATUS | +
I2C slave status.
+Enumerator | |
---|---|
I2C_OK | I2C OK. + |
I2C_BUSY | I2C Bus busy. + |
I2C_NACK | I2C Not Acknowledge. + |
void I2C_init | +( | +const uint16_t | +speed | ) | ++ |
Enable I2c module on arduino board (including pull-ups, enabling of ACK, and setting clock frequency)
+[in] | speed | - I2C bus speed in KHz |
bool I2C_is_busy | +( | +void | +) | ++ |
Get I2C busy status.
+uint8_t I2C_rd8 | +( | +const bool | +ack | ) | ++ |
Receive byte from bus.
+[in] | ack | - true if wait for ack |
I2C_STATUS I2C_read | +( | +I2C_SLAVE * | +slave, | +
+ | + | const uint16_t | +reg_addr, | +
+ | + | uint8_t * | +data, | +
+ | + | const uint16_t | +bytes | +
+ | ) | ++ |
This function reads data from the address specified and stores this data in the area provided by the pointer.
+[in,out] | slave | - pointer to the I2C slave structure |
[in] | reg_addr | - register address in register map |
[in,out] | data | - pointer to the first byte of a block of data to read |
[in] | bytes | - indicates how many bytes of data to read |
+
|
+ +inline | +
This inline is a wrapper to I2C_read in case of contigous operations.
+[in,out] | slave | - pointer to the I2C slave structure |
[in] | data | - pointer to the first byte of a block of data to read |
[in] | bytes | - indicates how many bytes of data to read |
void I2C_reset | +( | +void | +) | ++ |
I2C bus reset (Release SCL and SDA lines and re-enable module)
+uint8_t I2C_set_retries | +( | +const uint8_t | +retries | ) | ++ |
Change I2C message retries (in case of failure)
+[in] | retries | - I2C number of retries (max of 8) |
uint16_t I2C_set_speed | +( | +const uint16_t | +speed | ) | ++ |
Change I2C frequency.
+[in] | speed | - I2C bus speed in KHz (max 400KHz on AVR) |
[in] | speed | - I2C speed in KHz (max 400KHz on avr) |
uint16_t I2C_set_timeout | +( | +const uint16_t | +timeout | ) | ++ |
Change I2C ack timeout.
+[in] | timeout | - I2C ack timeout (500 ms max) |
+
|
+ +inline | +
Get I2C slave address.
+[in] | slave | - pointer to the I2C slave structure |
+
|
+ +inline | +
Get I2C current register address (addr may passed this way in procedures if contigous accesses)
+[in] | slave | - pointer to the I2C slave structure |
+
|
+ +inline | +
Get I2C register map size (for access)
+[in] | slave | - pointer to the I2C slave structure |
void I2C_slave_init | +( | +I2C_SLAVE * | +slave, | +
+ | + | const uint8_t | +sl_addr, | +
+ | + | const I2C_INT_SIZE | +reg_sz | +
+ | ) | ++ |
Init an I2C slave structure for cMI2C communication.
+[in] | slave | - pointer to the I2C slave structure to init |
[in] | sl_addr | - I2C slave address |
[in] | reg_sz | - internal register map size |
bool I2C_slave_set_addr | +( | +I2C_SLAVE * | +slave, | +
+ | + | const uint8_t | +sl_addr | +
+ | ) | ++ |
Change I2C slave address.
+[in,out] | slave | - pointer to the I2C slave structure to init |
[in] | sl_addr | - I2C slave address |
bool I2C_slave_set_reg_size | +( | +I2C_SLAVE * | +slave, | +
+ | + | const I2C_INT_SIZE | +reg_sz | +
+ | ) | ++ |
Change I2C registers map size (for access)
+[in,out] | slave | - pointer to the I2C slave structure |
[in] | reg_sz | - internal register map size |
void I2C_slave_set_rw_func | +( | +I2C_SLAVE * | +slave, | +
+ | + | const ci2c_fct_ptr | +func, | +
+ | + | const I2C_RW | +rw | +
+ | ) | ++ |
Redirect slave I2C read/write function (if needed for advanced use)
+[in] | slave | - pointer to the I2C slave structure to init |
[in] | func | - pointer to read/write function to affect |
[in] | rw | - 0 = write function, 1 = read function |
Send I2C address.
+[in] | slave | - pointer to the I2C slave structure |
[in] | rw | - read/write transaction |
bool I2C_start | +( | +void | +) | ++ |
Send start condition.
+bool I2C_stop | +( | +void | +) | ++ |
Send stop condition.
+void I2C_uninit | +( | +) | ++ |
Disable I2c module on arduino board (releasing pull-ups, and TWI control)
+bool I2C_wr8 | +( | +const uint8_t | +dat | ) | ++ |
Send byte on bus.
+[in] | dat | - data to be sent |
I2C_STATUS I2C_write | +( | +I2C_SLAVE * | +slave, | +
+ | + | const uint16_t | +reg_addr, | +
+ | + | uint8_t * | +data, | +
+ | + | const uint16_t | +bytes | +
+ | ) | ++ |
This function writes the provided data to the address specified.
+[in,out] | slave | - pointer to the I2C slave structure |
[in] | reg_addr | - register address in register map |
[in] | data | - pointer to the first byte of a block of data to write |
[in] | bytes | - indicates how many bytes of data to write |
+
|
+ +inline | +
This inline is a wrapper to I2C_write in case of contigous operations.
+[in,out] | slave | - pointer to the I2C slave structure |
[in] | data | - pointer to the first byte of a block of data to write |
[in] | bytes | - indicates how many bytes of data to write |
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
#include <ci2c.h>
+Functions | |
void | setup () |
void | loop () |
bool | I2C_wr_advanced (I2C_SLAVE *slave, const uint16_t reg_addr, uint8_t *data, const uint16_t bytes) |
This procedure calls appropriate functions to perform a proper send transaction on I2C bus. More... | |
bool | I2C_rd_advanced (I2C_SLAVE *slave, const uint16_t reg_addr, uint8_t *data, const uint16_t bytes) |
This procedure calls appropriate functions to perform a proper receive transaction on I2C bus. More... | |
bool | I2C_get_chip_id (I2C_SLAVE *slave, uint8_t *data) |
This procedure calls appropriate functions to get chip ID of FUJITSU devices. More... | |
+Variables | |
const uint8_t | blank = 0xEE |
I2C_SLAVE | FRAM |
bool I2C_get_chip_id | +( | +I2C_SLAVE * | +slave, | +
+ | + | uint8_t * | +data | +
+ | ) | ++ |
This procedure calls appropriate functions to get chip ID of FUJITSU devices.
+[in,out] | slave | - pointer to the I2C slave structure |
[in,out] | data | - pointer to the first byte of a block of data to read |
bool I2C_rd_advanced | +( | +I2C_SLAVE * | +slave, | +
+ | + | const uint16_t | +reg_addr, | +
+ | + | uint8_t * | +data, | +
+ | + | const uint16_t | +bytes | +
+ | ) | ++ |
This procedure calls appropriate functions to perform a proper receive transaction on I2C bus.
+[in,out] | slave | - pointer to the I2C slave structure |
[in] | reg_addr | - register address in register map |
[in,out] | data | - pointer to the first byte of a block of data to read |
[in] | bytes | - indicates how many bytes of data to read |
bool I2C_wr_advanced | +( | +I2C_SLAVE * | +slave, | +
+ | + | const uint16_t | +reg_addr, | +
+ | + | uint8_t * | +data, | +
+ | + | const uint16_t | +bytes | +
+ | ) | ++ |
This procedure calls appropriate functions to perform a proper send transaction on I2C bus.
+[in,out] | slave | - pointer to the I2C slave structure |
[in] | reg_addr | - register address in register map |
[in] | data | - pointer to the first byte of a block of data to write |
[in] | bytes | - indicates how many bytes of data to write |
void loop | +( | +) | ++ |
void setup | +( | +) | ++ |
const uint8_t blank = 0xEE | +
I2C_SLAVE FRAM | +
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
#include <ci2c.h>
+Functions | |
void | setup () |
void | loop () |
+Variables | |
const uint8_t | blank = 0xEE |
I2C_SLAVE | FRAM |
void loop | +( | +) | ++ |
void setup | +( | +) | ++ |
const uint8_t blank = 0xEE | +
I2C_SLAVE FRAM | +
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
#include <ci2c.h>
+Functions | |
void | setup () |
void | loop () |
+Variables | |
const uint8_t | blank = 0xEE |
I2C_SLAVE | FRAM |
void loop | +( | +) | ++ |
void setup | +( | +) | ++ |
const uint8_t blank = 0xEE | +
I2C_SLAVE FRAM | +
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
File in examples/ci2c_advanced | Includes file in src |
---|---|
ci2c_advanced.ino | ci2c.h |
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
File in examples/ci2c_master_read | Includes file in src |
---|---|
ci2c_master_read.ino | ci2c.h |
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
File in examples/ci2c_master_write | Includes file in src |
---|---|
ci2c_master_write.ino | ci2c.h |
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
+Files | |
file | ci2c_master_write.ino |
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
+Files | |
file | ci2c.c |
arduino master i2c in plain c code | |
file | ci2c.h [code] |
arduino i2c in plain c declarations | |
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
+Directories | |
directory | ci2c_advanced |
directory | ci2c_master_read |
directory | ci2c_master_write |
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
+Files | |
file | ci2c_master_read.ino |
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
This page explains how to interpret the graphs that are generated by doxygen.
+Consider the following example:
This will result in the following graph:
+The boxes in the above graph have the following meaning:
+The arrows have the following meaning:
+
- cI2C=Arduino Hardware I2C for AVR (in plain c)
-
- |
-
Arduino Hardware I2C for AVR (plain c)
-Hardware I2C library for AVR MCUs (lib intended for I2C protocols development in c, for easier ports to other MCUs)
-No refactoring is required when switching between cI2C & WireWrapper libs; Both libs share same Typedefs, Functions & Parameters.
-This library is intended to be able to work with multiple slaves connected on the same I2C bus. Thus, the I2C bus and Slaves are defined separately.
-I2C_init(speed)
: speed can be chosen from I2C_SPEED
enum for convenience, or passing an integer as parameterI2C_SLAVE
typedef to declare slaves structsI2C_slave_init(pSlave, addr, regsize)
pSlave
: pointer to the slave struct to initializeaddr
: slave I2C address (don't shift addr, lib takes care of that)regsize
: width of internal slave registers (to be chosen from I2C_INT_SIZE
)I2C_slave_set_rw_func(pSlave, pFunc, rw)
pSlave
: pointer to the slave declaration to initializepFunc
: pointer to the Read or Write bypass functionrw
: can be chosen from I2C_RW
enum (wr=0, rd=1)After all inits are done, the lib can basically be used this way:
I2C_read(pSlave, regaddr, pData, bytes)
pSlave
: pointer to the slave struct to read fromregaddr
: start address to read frompData
: pointer to the place where datas read will be storedbytes
: number of bytes to read from slavetrue
if read is ok, false
otherwiseI2C_write(pSlave, regaddr, pData, bytes)
pSlave
: pointer to the slave struct to write toregaddr
: start address to write topData
: pointer to the block of datas to write to slavebytes
: number of bytes to write to slavetrue
if write is ok, false
otherwisefollowing examples should work with any I2C EEPROM/FRAM with address 0x50 (yet function to get Chip ID are device dependent (and will probably only work on FUJITSU devices))
Doxygen doc can be generated using "Doxyfile".
- -See release notes
-cI2C
WireWrapper
- cI2C=Arduino Hardware I2C for AVR (in plain c)
-
- |
-
Arduino Hardware I2C for AVR (plain c) 2017-2018 SMFSW
-Feel free to share your thoughts @ xgarm about: anbo ziax@ gmai l.com
** Actual: v1.3 3 May 2018:
v1.2 30 Nov 2017:
v1.1 29 Nov 2017:
v1.0 21 Nov 2017:
v0.6 12 Jul 2017:
v0.5 31 Jan 2017:
v0.4 23 Jan 2017:
v0.3 22 Jan 2017:
v0.2 16 Jan 2017:
- cI2C=Arduino Hardware I2C for AVR (in plain c)
-
- |
-
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
ci2c slave config and control parameters + More...
+ +#include <src/ci2c.h>
+Data Fields | |
struct { | |
uint8_t addr | |
Slave address. More... | |
I2C_INT_SIZE reg_size | |
Slave internal registers size. More... | |
ci2c_fct_ptr wr | |
Slave write function pointer. More... | |
ci2c_fct_ptr rd | |
Slave read function pointer. More... | |
} | cfg |
uint16_t | reg_addr |
Internal current register address. More... | |
I2C_STATUS | status |
Status of the last communications. More... | |
ci2c slave config and control parameters
+uint8_t StructI2CSlave::addr | +
Slave address.
+ +struct { ... } StructI2CSlave::cfg | +
ci2c_fct_ptr StructI2CSlave::rd | +
Slave read function pointer.
+ +uint16_t StructI2CSlave::reg_addr | +
Internal current register address.
+ +I2C_INT_SIZE StructI2CSlave::reg_size | +
Slave internal registers size.
+ +I2C_STATUS StructI2CSlave::status | +
Status of the last communications.
+ +ci2c_fct_ptr StructI2CSlave::wr | +
Slave write function pointer.
+ +
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
ci2c bus parameters + More...
+ci2c bus parameters
+
+ Arduino Hardware I2C for AVR MCUs (plain c)
+ 1.3
+
+ Arduino Hardware I2C for AVR MCUs (plain c) documentation
+ |
+
static ci2c bus config and control parameters + More...
+static ci2c bus config and control parameters
+