53 #define HARDWARE_I2C_PRESCALER_1 0 54 #define HARDWARE_I2C_PRESCALER_4 1 55 #define HARDWARE_I2C_PRESCALER_16 2 56 #define HARDWARE_I2C_PRESCALER_64 3 63 #define I2C_READ_BIT 0x01 64 #define I2C_WRITE_BIT 0x00 69 #define STATUS_START 0x08 70 #define STATUS_REPEATED_START 0x10 71 #define STATUS_ADDRESS_WRITE_ACK 0x18 72 #define STATUS_ADDRESS_WRITE_NACK 0x20 73 #define STATUS_WRITE_ACK 0x28 74 #define STATUS_WRITE_NACK 0x30 75 #define STATUS_ARBITRATION_LOST 0x38 76 #define STATUS_ADDRESS_READ_ACK 0x40 77 #define STATUS_ADDRESS_READ_NACK 0x48 78 #define STATUS_READ_ACK 0x50 79 #define STATUS_READ_NACK 0x58 84 #define HW_I2C_DELAY 1 85 #define HW_I2C_TIMEOUT 20000 96 #define I2C_8ADDR(address) (address >> 1) void quikeval_I2C_init(void)
Initializes Linduino I2C port.
int8_t i2c_read_byte_data(uint8_t address, uint8_t command, uint8_t *value)
Read a byte of data at register specified by "command", store in "value".
int8_t i2c_write_byte(uint8_t address, uint8_t value)
Write "value" byte to device at "address".
void i2c_enable(void)
i2c_enable or quikeval_I2C_init must be called before using any of the other I2C routines.
void i2c_stop()
Write stop bit to the hardware I2C port.
union LT_union_int32_4bytes data
int8_t i2c_read_word_data(uint8_t address, uint8_t command, uint16_t *value)
Read a 16-bit word of data from register specified by "command".
int8_t i2c_write_word_data(uint8_t address, uint8_t command, uint16_t value)
Write a 16-bit word of data to register specified by "command".
uint8_t i2c_read(int8_t ack)
Read a data byte from the hardware I2C port.
int8_t i2c_write(uint8_t data)
Send a data byte to hardware I2C port.
void quikeval_I2C_connect(void)
Switch MUX to connect I2C pins to QuikEval connector.
int8_t i2c_write_byte_data(uint8_t address, uint8_t command, uint8_t value)
Write a byte of data to register specified by "command".
int8_t i2c_write_block_data(uint8_t address, uint8_t command, uint8_t length, uint8_t *values)
Write a block of data, starting at register specified by "command" and ending at (command + length - ...
int8_t i2c_read_block_data(uint8_t address, uint8_t command, uint8_t length, uint8_t *values)
Read a block of data, starting at register specified by "command" and ending at (command + length - 1...
int8_t i2c_repeated_start()
Write a repeat start bit to the hardware I2C port.
int8_t i2c_read_byte(uint8_t address, uint8_t *value)
Read a byte, store in "value".
int8_t i2c_two_byte_command_read_block(uint8_t address, uint16_t command, uint8_t length, uint8_t *values)
Write a two command bytes, then receive a block of data.
int8_t i2c_poll(uint8_t i2c_address)
Poll the I2C port and look for an acknowledge.
int8_t i2c_start()
Write start bit to the hardware I2C port.