#include <pas-co2-pal-i2c.hpp>
◆ init()
virtual Error_t pasco2::I2CPAL::init |
( |
| ) |
|
|
pure virtual |
Initializes the I2C interface.
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implemented in I2CPALIno.
◆ deinit()
virtual Error_t pasco2::I2CPAL::deinit |
( |
| ) |
|
|
pure virtual |
Deinitializes the I2C interface.
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implemented in I2CPALIno.
◆ setClockFreq()
virtual Error_t pasco2::I2CPAL::setClockFreq |
( |
const uint32_t |
clockHz | ) |
|
|
pure virtual |
Sets the I2C bus frequency.
- Parameters
-
[in] | clockHz | Clock frequency in Hertzs |
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implemented in I2CPALIno.
◆ read()
virtual Error_t pasco2::I2CPAL::read |
( |
const uint8_t |
slave7BAddr, |
|
|
const uint8_t |
memAddr, |
|
|
uint8_t * |
data, |
|
|
uint16_t & |
length |
|
) |
| |
|
pure virtual |
Reads from the I2C interface 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 |
Implemented in I2CPALIno.
◆ write()
virtual Error_t pasco2::I2CPAL::write |
( |
const uint8_t |
slave7BAddr, |
|
|
const uint8_t |
memAddr, |
|
|
const uint8_t * |
data, |
|
|
uint16_t & |
length |
|
) |
| |
|
pure virtual |
Writes in the I2C interface 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 |
Implemented in I2CPALIno.
The documentation for this class was generated from the following file: