|
C++ DevKit
C++ set of OOP library
|
This is a C++ wrapper for the original pico SDK spi master API, adapted to FreeRTOS environment. More...
#include <rtos_hw_spi.h>


Public Member Functions | |
| rtos_HW_SPI_Master (struct_ConfigMasterSPI master_config, irq_num_t dma_tx_irq_number=DMA_IRQ_0, irq_handler_t dma_tx_irq_handler=nullptr, irq_num_t dma_rx_irq_number=DMA_IRQ_1, irq_handler_t dma_rx_irq_handler=nullptr) | |
| Construct a new hw spi master object. | |
| int | burst_write_8 (uint8_t *src, size_t len) override |
| send a serie of 8 bit data on the SPI MOSI port DMA not implemented | |
| int | burst_write_16 (uint16_t *src, size_t len) override |
| send a serie of 16 bit data on the SPI MOSI port. Use DMA. | |
| int | repeat_write_16 (uint16_t *src, size_t len) |
| repeat a single 16 bit data on the SPI MOSI port. Use DMA. | |
| int | burst_read_16 (uint16_t *dst, size_t len) |
| read a serie of 16 bit data on the SPI MISO port. Use DMA. | |
| int | burst_write_read_8 (uint8_t *src, uint8_t *dest, size_t len) override |
| read / write a serie of 8 bit data on the SPI MISO/MOSI ports DMA not implemented | |
| int | burst_read_8 (uint8_t repeated_tx_data, uint8_t *dest, size_t len) |
| read a serie of byte on the SPI MISO port DMA not implemented | |
| void | spi_tx_dma_isr () |
| ISR handler for SPI TX DMA. | |
| void | spi_rx_dma_isr () |
| ISR handler for SPI RX DMA. | |
Public Member Functions inherited from HW_SPI_Master | |
| HW_SPI_Master (struct_ConfigMasterSPI master_config) | |
| Construct a new hw spi master object. | |
| int | single_write_8 (uint8_t byte_value) |
| write a single byte on the SPI MOSI port | |
| int | single_write_16 (uint16_t word_value) |
| write a single 16bit word on the SPI MOSI port | |
| int | single_read_8 (uint8_t *dest) |
| read a single byte on the SPI MISO port | |
| int | burst_read_8 (uint8_t repeated_tx_data, uint8_t *dest, size_t len) |
| read a serie of byte on the SPI MISO port | |
| bool | device_is_connected (uint8_t slave_address) |
| a test that checks if the slave_address device is connected | |
Public Attributes | |
| HW_DMA * | dma_rx |
| the DMA channel used for SPI RX | |
| HW_DMA * | dma_tx |
| the DMA channel used for SPI TX | |
Public Attributes inherited from HW_SPI_Master | |
| spi_inst_t * | spi |
| the spi hardware instance of the Pico that handles the spi master | |
This is a C++ wrapper for the original pico SDK spi master API, adapted to FreeRTOS environment.
| rtos_HW_SPI_Master::rtos_HW_SPI_Master | ( | struct_ConfigMasterSPI | master_config, |
| irq_num_t | dma_tx_irq_number = DMA_IRQ_0, | ||
| irq_handler_t | dma_tx_irq_handler = nullptr, | ||
| irq_num_t | dma_rx_irq_number = DMA_IRQ_1, | ||
| irq_handler_t | dma_rx_irq_handler = nullptr ) |
Construct a new hw spi master object.
| master_config | the data structure that contains SPI configuration |
| dma_tx_irq_number | the DMA IRQ number attached to TX DMA |
| dma_tx_irq_handler | the DMA IRQ handler attached to TX DMA |
| dma_rx_irq_number | the DMA IRQ number attached to RX DMA |
| dma_rx_irq_handler | the DMA IRQ handler attached to RX DMA |

| int rtos_HW_SPI_Master::burst_read_16 | ( | uint16_t * | dst, |
| size_t | len ) |
read a serie of 16 bit data on the SPI MISO port. Use DMA.
| dst | the destination of the data |
| len | the length of the serie |
| int rtos_HW_SPI_Master::burst_read_8 | ( | uint8_t | repeated_tx_data, |
| uint8_t * | dest, | ||
| size_t | len ) |
read a serie of byte on the SPI MISO port DMA not implemented
| repeated_tx_data | the byte sent on MOSI port during the read transfer |
| dest | the destination that receives the data |
| len | the length of the serie |
|
overridevirtual |
send a serie of 16 bit data on the SPI MOSI port. Use DMA.
| src | the source of the data |
| len | the length of the serie |
Reimplemented from HW_SPI_Master.
|
overridevirtual |
send a serie of 8 bit data on the SPI MOSI port DMA not implemented
| src | the source of the data |
| len | the lenght of the serie |
Reimplemented from HW_SPI_Master.
|
overridevirtual |
read / write a serie of 8 bit data on the SPI MISO/MOSI ports DMA not implemented
| src | the source of the data |
| dest | the destination of the data |
| len | the length of the serie |
Reimplemented from HW_SPI_Master.
| int rtos_HW_SPI_Master::repeat_write_16 | ( | uint16_t * | src, |
| size_t | len ) |
repeat a single 16 bit data on the SPI MOSI port. Use DMA.
| src | the source of the data |
| len | the length of the repetition |