This is a C++ wrapper for the original pico SDK i2c master API, adapted to FreeRTOS environment.
More...
#include <rtos_hw_i2c.h>
|
| | rtos_HW_I2C_Master (struct_ConfigMasterI2C cfg) |
| | Constructor of the class.
|
| |
|
| ~rtos_HW_I2C_Master () |
| | Destructor of the class.
|
| |
| struct_I2CXferResult | burst_byte_write (uint8_t slave_address, uint8_t mem_addr, uint8_t *source_address, size_t length) |
| | a function member to write a burst of data to a slave device, using DMA and FreeRTOS queue
|
| |
| struct_I2CXferResult | repeat_byte_write (uint8_t slave_address, uint8_t mem_addr, uint8_t pattern, size_t length) |
| | a function member to write a burst of data to a slave device, using DMA and FreeRTOS queue
|
| |
| struct_I2CXferResult | burst_byte_read (uint8_t slave_address, uint8_t mem_address, uint8_t *destination_address, size_t length) |
| | a convenient C++ member wrapper to read a block of data starting at a slave memory address, using DMA and FreeRTOS queue
|
| |
|
void | i2c_dma_isr () |
| | the I2C IRQ handler, to be called in the main program IRQ map
|
| |
| | HW_I2C_Master (struct_ConfigMasterI2C master_config) |
| | Construct a new hw i2c master object.
|
| |
| 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.
|
| |
| 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
|
| |
|
|
HW_DMA * | tx_dma |
| | the DMA channel used for I2C TX
|
| |
|
SemaphoreHandle_t | i2c_tx_FIFO_empty |
| | semaphore to signal the TX FIFO of I2C is empty
|
| |
|
SemaphoreHandle_t | i2c_access_mutex |
| | semaphore to protect access to the I2C bus
|
| |
|
|
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, adapted to FreeRTOS environment.
◆ rtos_HW_I2C_Master()
Constructor of the class.
- Parameters
-
| cfg | the configuration structure for the I2C master |
◆ burst_byte_read()
| struct_I2CXferResult rtos_HW_I2C_Master::burst_byte_read |
( |
uint8_t | slave_address, |
|
|
uint8_t | mem_address, |
|
|
uint8_t * | destination_address, |
|
|
size_t | length ) |
|
virtual |
a convenient C++ member wrapper to read a block of data starting at a slave memory address, using DMA and FreeRTOS queue
- Parameters
-
| slave_address | the slave address |
| mem_address | the starting address of slave memory to read from |
| destination_address | Pointer to buffer to receive data |
| length | the size of the block of data |
- Returns
- struct_I2CXferResult code error
Reimplemented from HW_I2C_Master.
◆ burst_byte_write()
| struct_I2CXferResult rtos_HW_I2C_Master::burst_byte_write |
( |
uint8_t | slave_address, |
|
|
uint8_t | mem_addr, |
|
|
uint8_t * | source_address, |
|
|
size_t | length ) |
|
virtual |
a function member to write a burst of data to a slave device, using DMA and FreeRTOS queue
- Parameters
-
| slave_address | the 7-bit I2C slave address |
| mem_addr | the adresse to write in the slave peripheral |
| source_address | the address of the data to send |
| length | the number of data to send |
- Returns
- struct_I2CXferResult code error
Reimplemented from HW_I2C_Master.
◆ repeat_byte_write()
| struct_I2CXferResult rtos_HW_I2C_Master::repeat_byte_write |
( |
uint8_t | slave_address, |
|
|
uint8_t | mem_addr, |
|
|
uint8_t | pattern, |
|
|
size_t | length ) |
a function member to write a burst of data to a slave device, using DMA and FreeRTOS queue
- Parameters
-
| slave_address | the 7-bit I2C slave address |
| mem_addr | the adresse to write in the slave peripheral |
| pattern | the data to send |
| length | the number of time te byte at sourcedata to send |
- Returns
The documentation for this class was generated from the following files: