PixelKey
NeoPixel USB Key
Loading...
Searching...
No Matches
NeoPixel Data Transfer

Modules

 NeoPixel Data Transfer Internals
 

Macros

#define NPDATA_FRAME_BUFFER_SIZE   (PIXELKEY_NEOPIXEL_COUNT * sizeof(color_rgb_t))
 Size of the frame buffer in bytes.
 

Enumerations

enum  transfer_status_t { TRANSFER_STATUS_IDLE , TRANSFER_STATUS_WORKING }
 Status of the NeoPixel data transfer. More...
 

Functions

void npdata_open (void)
 Opens the peripherals needed for data transmission to the NeoPixels.
 
void npdata_frame_send (void)
 Kicks off a frame transmission to the attached 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_tnpdata_frame_buffer_get (void)
 Gets a pointer to the frame buffer. More...
 

Detailed Description

Enumeration Type Documentation

◆ transfer_status_t

Status of the NeoPixel data transfer.

Enumerator
TRANSFER_STATUS_IDLE 

No active transfer.

TRANSFER_STATUS_WORKING 

A transfer is currently active.

Function Documentation

◆ 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
indexThe index to write.
[in]p_colorPointer to the color to copy.

◆ npdata_frame_buffer_get()

volatile color_rgb_t * npdata_frame_buffer_get ( void  )

Gets a pointer to the frame buffer.

Warning
Do not write to the frame buffer while npdata_status_get() returns TRANSFER_STATUS_WORKING.

◆ npdata_status_get()

transfer_status_t npdata_status_get ( void  )

Gets the current status of the NeoPixel data transfer.

Return values
TRANSFER_STATUS_IDLENo transfers are active.
TRANSFER_STATUS_WORKINGData is currently being transferred.