C++ DevKit
C++ set of OOP library
|
this is a C++ wrapper for the original pico SDK i2c master API More...
#include <hw_i2c.h>
Public Member Functions | |
HW_I2C_Master (struct_ConfigMasterI2C master_config) | |
Construct a new hw i2c master object. | |
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. | |
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 | |
this is a C++ wrapper for the original pico SDK i2c master API
HW_I2C_Master::HW_I2C_Master | ( | struct_ConfigMasterI2C | master_config | ) |
Construct a new hw i2c master object.
master_config |
struct_I2CXferResult HW_I2C_Master::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.
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 |
struct_I2CXferResult HW_I2C_Master::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
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 |
std::set< uint8_t > HW_I2C_Master::bus_scan | ( | ) |
A utility that scan the I2C bus and return the set of answering devices.
bool HW_I2C_Master::device_is_connected | ( | uint8_t | slave_address | ) |
utility to know if a device is connected
slave_address |
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.
slave_address | the slave address |
mem_addr | the address of slave memory to read from |
dest | Pointer to buffer to receive data |
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.
slave_address | the slave address |
mem_addr | the slave memory |
mem_value | the byte to write |