#include <pas-co2-pal-i2c-ino.hpp>
◆ I2CPALIno()
I2CPALIno::I2CPALIno |
( |
TwoWire * |
wire = &Wire | ) |
|
I2C PAL Ino constructor.
- Parameters
-
[in] | wire | Arduino Wire instance |
◆ ~I2CPALIno()
I2CPALIno::~I2CPALIno |
( |
| ) |
|
◆ init()
Initializes the I2C Arduino PAL.
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implements pasco2::I2CPAL.
◆ deinit()
Deinitializes the I2C Arduino PAL.
- Warning
- end() call not implemented depending on core Arduino toolchain flags are not here declared.
- Returns
- PAS CO2 error code
- Return values
-
Implements pasco2::I2CPAL.
◆ setClockFreq()
Error_t I2CPALIno::setClockFreq |
( |
const uint32_t |
clockHz | ) |
|
|
virtual |
Sets the I2C Arduino PAL frequency.
- Parameters
-
[in] | clockHz | Clock frequency in Hertzs |
- Returns
- PAS CO2 error code
- Return values
-
Implements pasco2::I2CPAL.
◆ read()
Error_t I2CPALIno::read |
( |
const uint8_t |
slave7BAddr, |
|
|
const uint8_t |
memAddr, |
|
|
uint8_t * |
data, |
|
|
uint16_t & |
length |
|
) |
| |
|
virtual |
Reads from the I2C Arduino PAL the device memory registers.
The memory addresses length is 8 bits, which point to 8 bits word memory registers. In bulk read mode (length > 1 byte), the register address passed by argument will be the start read address, and the subsequent registers will be read up until the requested length is satisfied.
- Parameters
-
[in] | slave7BAddr | Slave address 7 bits format. Without write/read bit (8 bit address right shifted 1 bit) |
[in] | memAddress | Device memory register start read address |
[out] | *data | Pointer to the array that will store the read data |
[in,out] | length | Number of bytes to be read from the bus. Outputs the actual number of bytes read. |
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implements pasco2::I2CPAL.
◆ write()
Error_t I2CPALIno::write |
( |
const uint8_t |
slave7BAddr, |
|
|
const uint8_t |
memAddr, |
|
|
const uint8_t * |
data, |
|
|
uint16_t & |
length |
|
) |
| |
|
virtual |
Writes in the I2C Arduino PAL the device memory registers.
The memory addresses length is 8 bits, which point to 8 bits word memory registers. In bulk write mode (length > 1 byte), the register address passed by argument will be the start write address, and the subsequent registers will be written up until the requested length is satisfied.
- Parameters
-
[in] | slave7BAddr | Slave address 7 bits format. Without write/read bit (8 bit address right shifted 1 bit) |
[in] | memAddress | Device memory register start write address |
[in] | *data | Pointer to the data array to be written |
[in,out] | length | Number of bytes to be written in the bus. Outputs the actual number of bytes written. |
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implements pasco2::I2CPAL.
The documentation for this class was generated from the following files: