|
| static void | push_data_to_buffer (uint32_t *const p_block) |
| | Push new data to the secondary (or primary) buffer. More...
|
| |
|
static volatile uint32_t npdata_gpt_buffer[2][(8U)] | __attribute__ ((aligned(4))) |
| | GPT compare ping-pong buffer for generating NeoPixel timing waveforms.
|
| |
| volatile color_rgb_t * | npdata_frame_buffer_get (void) |
| | Gets a pointer to the frame buffer. More...
|
| |
|
void | npdata_frame_send (void) |
| | Kicks off a frame transmission to the attached NeoPixels.
|
| |
|
void | npdata_open (void) |
| | Opens the peripherals needed for data transmission to the NeoPixels.
|
| |
| void | npdata_color_set (uint32_t index, color_rgb_t const *const p_color) |
| | Copies a color to the specified index of the frame buffer. More...
|
| |
| transfer_status_t | npdata_status_get (void) |
| | Gets the current status of the NeoPixel data transfer. More...
|
| |
|
|
volatile color_rgb_t | g_npdata_frame [(4U)] = {0} |
| | NeoPixel frame buffer.
|
| |
|
static uint32_t | npdata_frame_cnt = 0 |
| |
|
static uint32_t | npdata_frame_idx = (0U) |
| | Current NeoPixel index to write to the buffers.
|
| |
|
static uint32_t | npdata_color_bit = ( (UINT32_C(1) << (NEOPIXEL_COLOR_BITS - 1)) ) |
| | Current bit to write to the buffers.
|
| |
|
static uint32_t | npdata_color_word = 0U |
| | Current full shift-register word for the color being written.
|
| |
|
static uint32_t | npdata_b0_counts = 0 |
| | Timer counts for the high period of a 0-bit.
|
| |
|
static uint32_t | npdata_b1_counts = 0 |
| | Timer counts for the high period of a 1-bit.
|
| |
Operation
A pulse-code waveform is transmitted at 800 kHz. To achieve this, the Capture Compare B channel is utilized. The DMAC is configured to ping-pong between two buffers and set the timing data to the capture compare of the GPT. Using ping-pong buffering allows an overall smaller buffer footprint since the timing data can be calculated on the fly for each NeoPixel. Otherwise a buffer would be needed that is 24 uint32 words for each NeoPixel.
◆ dmac0_repeat_isr()
| void dmac0_repeat_isr |
( |
void |
| ) |
|
DMAC_INT ISR handler.
- Note
- This overrides the built-in FSP DMAC ISR.
This is setup to trigger on each repeat size completion.
◆ npdata_color_set()
| void npdata_color_set |
( |
uint32_t |
index, |
|
|
color_rgb_t const *const |
p_color |
|
) |
| |
Copies a color to the specified index of the frame buffer.
- Parameters
-
| index | The index to write. |
| [in] | p_color | Pointer to the color to copy. |
◆ npdata_frame_buffer_get()
| volatile color_rgb_t * npdata_frame_buffer_get |
( |
void |
| ) |
|
◆ npdata_status_get()
Gets the current status of the NeoPixel data transfer.
- Return values
-
| TRANSFER_STATUS_IDLE | No transfers are active. |
| TRANSFER_STATUS_WORKING | Data is currently being transferred. |
◆ npdata_transfer_callback()
| void npdata_transfer_callback |
( |
dmac_callback_args_t * |
p_args | ) |
|
DMAC interrupt callback; unused.
- Parameters
-
| p_args | Pointer to callback arguments. |
- Note
- This is unused and is present as a formality to enable the FSP driver to configure the interrupt; see dmac_repeat_isr.
◆ push_data_to_buffer()
| static void push_data_to_buffer |
( |
uint32_t *const |
p_block | ) |
|
|
inlinestatic |
Push new data to the secondary (or primary) buffer.
- Parameters
-
| [in] | p_block | Pointer to the block to write the data to. |