this is a C++ wrapper for the original pico SDK i2c master API
More...
#include <hw_i2c.h>
|
| | HW_I2C_Master (struct_ConfigMasterI2C master_config) |
| | Construct a new hw i2c master object.
|
| |
| virtual struct_I2CXferResult | burst_byte_write (uint8_t slave_address, uint8_t mem_addr, uint8_t *src, size_t len) |
| | a convenient C++ member wrapper to write a block of data starting at a slave memory address. The operation is bounded by a timeout
|
| |
| struct_I2CXferResult | single_byte_write (uint8_t slave_address, uint8_t mem_addr, uint8_t mem_value) |
| | a convenient C++ member wrapper to write a single byte at a slave memory address. The operation is bounded by a timeout.
|
| |
| struct_I2CXferResult | single_byte_read (uint8_t slave_address, uint8_t mem_addr, uint8_t *dest) |
| | a convenient C++ member wrapper to read a single byte at a slave memory address. The operation is bounded by a timeout.
|
| |
| virtual struct_I2CXferResult | burst_byte_read (uint8_t slave_address, uint8_t mem_addr, uint8_t *dest, size_t len) |
| | a convenient C++ member wrapper to read a block of data starting at a slave memory address. The operation is bounded by a timeout.
|
| |
| std::set< uint8_t > | bus_scan () |
| | A utility that scan the I2C bus and return the set of answering devices.
|
| |
| bool | device_is_connected (uint8_t slave_address) |
| | utility to know if a device is connected
|
| |
|
|
i2c_inst_t * | i2c |
| | the i2c hardware instance of the Pico that handles the i2c master
|
| |
|
irq_handler_t | i2c_master_exclusive_irq_handler = NULL |
| | a function pointer to the IRQ i2c_master_exclusive_handler, to the program that manage the I2C IRQ when used with DMA
|
| |
|
irq_num_t | i2c_irq_number |
| | the attached irq to the i2c instance
|
| |
this is a C++ wrapper for the original pico SDK i2c master API
◆ HW_I2C_Master()
Construct a new hw i2c master object.
- Parameters
-
◆ burst_byte_read()
| struct_I2CXferResult HW_I2C_Master::burst_byte_read |
( |
uint8_t | slave_address, |
|
|
uint8_t | mem_addr, |
|
|
uint8_t * | dest, |
|
|
size_t | len ) |
|
virtual |
a convenient C++ member wrapper to read a block of data starting at a slave memory address. The operation is bounded by a timeout.
- Parameters
-
| slave_address | the slave address |
| mem_addr | the starting address of slave memory to read from |
| dest | Pointer to buffer to receive data |
| len | the size of the block of data |
- Returns
- struct_I2CXferResult
Reimplemented in rtos_HW_I2C_Master.
◆ burst_byte_write()
| struct_I2CXferResult HW_I2C_Master::burst_byte_write |
( |
uint8_t | slave_address, |
|
|
uint8_t | mem_addr, |
|
|
uint8_t * | src, |
|
|
size_t | len ) |
|
virtual |
a convenient C++ member wrapper to write a block of data starting at a slave memory address. The operation is bounded by a timeout
- Parameters
-
| slave_address | the slave address |
| mem_addr | the slave memory |
| src | the address of the block of data |
| len | the size of the block of data |
- Returns
- struct_I2CXferResult
Reimplemented in rtos_HW_I2C_Master.
◆ bus_scan()
| std::set< uint8_t > HW_I2C_Master::bus_scan |
( |
| ) |
|
A utility that scan the I2C bus and return the set of answering devices.
- Returns
- std::set<uint8_t> the set of responding addresses
◆ device_is_connected()
| bool HW_I2C_Master::device_is_connected |
( |
uint8_t | slave_address | ) |
|
utility to know if a device is connected
- Parameters
-
- Returns
- true the device responds ACK to a write
-
false no response
◆ single_byte_read()
| struct_I2CXferResult HW_I2C_Master::single_byte_read |
( |
uint8_t | slave_address, |
|
|
uint8_t | mem_addr, |
|
|
uint8_t * | dest ) |
a convenient C++ member wrapper to read a single byte at a slave memory address. The operation is bounded by a timeout.
- Parameters
-
| slave_address | the slave address |
| mem_addr | the address of slave memory to read from |
| dest | Pointer to buffer to receive data |
- Returns
- struct_I2CXferResult
◆ single_byte_write()
| struct_I2CXferResult HW_I2C_Master::single_byte_write |
( |
uint8_t | slave_address, |
|
|
uint8_t | mem_addr, |
|
|
uint8_t | mem_value ) |
a convenient C++ member wrapper to write a single byte at a slave memory address. The operation is bounded by a timeout.
- Parameters
-
| slave_address | the slave address |
| mem_addr | the slave memory |
| mem_value | the byte to write |
- Returns
- struct_I2CXferResult
The documentation for this class was generated from the following files: