|
| | Stm32SpiPixelStrip (SPI_TypeDef *spi, unsigned num_pixels, uint8_t *backing_data) |
| | Initializes the SPI peripheral.
|
| |
| void | hw_init (uint32_t spi_prescaler) |
| | Opens and initializes the SPI hardware.
|
| |
| void | update_sync () |
| | Updates the hardware from the backing data.
|
| |
|
| SPI_TypeDef * | spi_ |
| | SPI peripheral pointer.
|
| |
| SPI_HandleTypeDef | spiHandle_ |
| | Stm32 HAL device structure.
|
| |
| unsigned | numPixels_ |
| | Number of pixels to drive.
|
| |
| uint8_t * | data_ |
| | Backing framebuffer to use.
|
| |
| unsigned | currentByte_ |
| | Controls iteration over the data sequence when producing the output.
|
| |
| uint8_t | nextBit_ |
| | Controls iteration over the data sequence when producing the output.
|
| |
Definition at line 45 of file Stm32SpiPixelStrip.hxx.
◆ Stm32SpiPixelStrip()
| Stm32SpiPixelStrip::Stm32SpiPixelStrip |
( |
SPI_TypeDef * |
spi, |
|
|
unsigned |
num_pixels, |
|
|
uint8_t * |
backing_data |
|
) |
| |
|
inline |
Initializes the SPI peripheral.
- Parameters
-
| spi | the SPI peripheral instance, e.g. SPI0. |
| num_pixels | the number of RGB pixels to drive. |
| backing_data | array of 3*num_pixels which stores the RGB data to be sent to the devices. Note that the byte order is G R B in the storage. |
Definition at line 54 of file Stm32SpiPixelStrip.hxx.
◆ clear_iteration()
| void Stm32SpiPixelStrip::clear_iteration |
( |
| ) |
|
|
inlineprivate |
◆ eof()
| bool Stm32SpiPixelStrip::eof |
( |
| ) |
|
|
inlineprivate |
◆ hw_init()
| void Stm32SpiPixelStrip::hw_init |
( |
uint32_t |
spi_prescaler | ) |
|
|
inline |
Opens and initializes the SPI hardware.
- Parameters
-
| spi_prescaler | SPI_BAUDRATEPRESCALER_32 or a similar constant to match the necessary output timing. |
Definition at line 66 of file Stm32SpiPixelStrip.hxx.
◆ next_bit()
| bool Stm32SpiPixelStrip::next_bit |
( |
| ) |
|
|
inlineprivate |
◆ update_sync()
| void Stm32SpiPixelStrip::update_sync |
( |
| ) |
|
|
inline |
Updates the hardware from the backing data.
The update is synchronous, this call returns when all bytes are sent, or at least enqueued in the SPI peripheral's TX FIFO.
- Todo:
- use DMA instead of a critical section here.
Definition at line 95 of file Stm32SpiPixelStrip.hxx.
◆ currentByte_
| unsigned Stm32SpiPixelStrip::currentByte_ |
|
private |
Controls iteration over the data sequence when producing the output.
This is the index of the current byte.
Definition at line 169 of file Stm32SpiPixelStrip.hxx.
◆ data_
| uint8_t* Stm32SpiPixelStrip::data_ |
|
private |
◆ nextBit_
| uint8_t Stm32SpiPixelStrip::nextBit_ |
|
private |
Controls iteration over the data sequence when producing the output.
This is the mask of the next bit to use.
Definition at line 172 of file Stm32SpiPixelStrip.hxx.
◆ numPixels_
| unsigned Stm32SpiPixelStrip::numPixels_ |
|
private |
◆ spi_
| SPI_TypeDef* Stm32SpiPixelStrip::spi_ |
|
private |
◆ spiHandle_
| SPI_HandleTypeDef Stm32SpiPixelStrip::spiHandle_ |
|
private |
The documentation for this class was generated from the following file: