![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
Go to the source code of this file.
Functions | |
int8_t | i2c_read_byte (uint8_t address, uint8_t *value) |
LT_I2C_Wire: I2C Routines based on Wire library to communicate with Arduino based boards. More... | |
int8_t | i2c_write_byte (uint8_t address, uint8_t value) |
Write "value" byte to device at "address". More... | |
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". More... | |
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". More... | |
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". More... | |
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". More... | |
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) More... | |
int8_t | i2c_read_block_data (uint8_t address, uint8_t length, uint8_t *values) |
Read a block of data, no command byte, reads length number of bytes and stores it in values. More... | |
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 - 1) More... | |
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. More... | |
void | quikeval_I2C_init (void) |
Initializes Linduino I2C port. More... | |
void | quikeval_I2C_connect (void) |
Switch MUX to connect I2C pins to QuikEval connector. More... | |
void | i2c_enable () |
i2c_enable or quikeval_I2C_init must be called before using any of the other I2C routines. More... | |
void i2c_enable | ( | void | ) |
i2c_enable or quikeval_I2C_init must be called before using any of the other I2C routines.
Definition at line 344 of file LT_I2C_Wire.cpp.
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)
address | 7-bit I2C address |
command | Command byte |
length | Length of array |
values | Byte array to be read |
Definition at line 200 of file LT_I2C_Wire.cpp.
int8_t i2c_read_block_data | ( | uint8_t | address, |
uint8_t | length, | ||
uint8_t * | values | ||
) |
Read a block of data, no command byte, reads length number of bytes and stores it in values.
address | 7-bit I2C address |
length | Length of array |
values | Byte array to be read |
Definition at line 230 of file LT_I2C_Wire.cpp.
int8_t i2c_read_byte | ( | uint8_t | address, |
uint8_t * | value | ||
) |
LT_I2C_Wire: I2C Routines based on Wire library to communicate with Arduino based boards.
Read a byte, store in "value".
Wire.endTransmission() returns 0, 1, 2, 3, or 4. To maintain consistency with our Legacy LT_I2C library, a zero(false) or a non-zero(true) is tested. 0 .. success 1 .. length to long for buffer 2 .. address send, NACK received 3 .. data send, NACK received 4 .. other twi error (lost bus arbitration, bus error, ..)
Copyright 2018(c) Analog Devices, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
address | 7-bit I2C address |
value | Byte to be read |
Definition at line 72 of file LT_I2C_Wire.cpp.
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".
address | 7-bit I2C address |
command | Command byte |
value | Byte to be read |
Definition at line 104 of file LT_I2C_Wire.cpp.
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".
address | 7-bit I2C address |
command | Command byte |
value | Word to be read |
Definition at line 141 of file LT_I2C_Wire.cpp.
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.
address | 7-bit I2C address |
command | Command word |
length | Length of array |
values | Byte array to be read |
Definition at line 274 of file LT_I2C_Wire.cpp.
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 - 1)
address | 7-bit I2C address |
command | Command byte |
length | Length of array |
values | Byte array to be written |
Definition at line 253 of file LT_I2C_Wire.cpp.
int8_t i2c_write_byte | ( | uint8_t | address, |
uint8_t | value | ||
) |
Write "value" byte to device at "address".
address | 7-bit I2C address |
value | Byte to be written |
Definition at line 91 of file LT_I2C_Wire.cpp.
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".
address | 7-bit I2C address |
command | Command byte |
value | Byte to be written |
Definition at line 127 of file LT_I2C_Wire.cpp.
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".
address | 7-bit I2C address |
command | Command byte |
value | Word to be written |
Definition at line 176 of file LT_I2C_Wire.cpp.
void quikeval_I2C_connect | ( | void | ) |
Switch MUX to connect I2C pins to QuikEval connector.
This will disconnect SPI pins.
Definition at line 331 of file LT_I2C_Wire.cpp.
void quikeval_I2C_init | ( | void | ) |
Initializes Linduino I2C port.
Before communicating to the I2C port through the QuikEval connector, you must also run quikeval_I2C_connect to connect the I2C port to the QuikEval connector through the QuikEval MUX (and disconnect SPI).
Definition at line 324 of file LT_I2C_Wire.cpp.