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

PixelKey generic processes. More...

Modules

 Command Processor Internals
 
 Configuration
 
 PixelKey Keyframe Processor Internals
 
 Keyframes
 
 PixelKey Command Set
 
 Hardware Abstraction Layer for PixelKey
 Provides abstraction functions for various hardware methods.
 
 Real-Time Clock Abstraction
 
 Serial Communications Abstraction
 
 PixelKey Tasks
 

Enumerations

enum  pixelkey_error_t {
  PIXELKEY_ERROR_NONE = 0 , PIXELKEY_ERROR_INVALID_ARGUMENT = 1 , PIXELKEY_ERROR_BUFFER_FULL = 2 , PIXELKEY_ERROR_COMMUNICATION_ERROR = 3 ,
  PIXELKEY_ERROR_INPUT_BUFFER_OVERFLOW = 4 , PIXELKEY_ERROR_INDEX_OUT_OF_RANGE = 5 , PIXELKEY_ERROR_KEYFRAME_PROCESSING_STOPPED = 6 , PIXELKEY_ERROR_RTC_NOT_SET = 7 ,
  PIXELKEY_ERROR_NOT_ENOUGH_ARGUMENTS = 8 , PIXELKEY_ERROR_TOO_MANY_ARGUMENTS = 9 , PIXELKEY_ERROR_UNKNOWN_COMMAND = 10 , PIXELKEY_ERROR_KEY_NOT_FOUND = 16 ,
  PIXELKEY_ERROR_NV_MEMORY_ERROR = 17 , PIXELKEY_ERROR_VALUE_OUT_OF_RANGE = 18 , PIXELKEY_ERROR_NV_NOT_INITIALIZED = 19 , PIXELKEY_ERROR_NV_CRC_MISMATCH = 20 ,
  PIXELKEY_ERROR_MISSING_BLOCKS = 32 , PIXELKEY_ERROR_CRC_MISMATCH = 33 , PIXELKEY_ERROR_OUT_OF_MEMORY = 48 , PIXELKEY_ERROR_HAL_ERROR = 49
}
 PixelKey errors. More...
 

Functions

void pixelkey_frameproc_init (framerate_t framerate)
 Initializes the keyframe processor. More...
 
void pixelkey_keyframeproc_framerate_set (framerate_t framerate)
 Sets the framerate used to render keyframes. More...
 
uint32_t pixelkey_keyframeproc_framecount_get (void)
 Gets the total numbered of rendered frames. More...
 
pixelkey_error_t pixelkey_keyframeproc_render_frame (color_rgb_t *p_frame_buffer)
 Performs a render of the current keyframes. More...
 
pixelkey_error_t pixelkey_keyframeproc_push (uint8_t index, keyframe_base_t *p_keyframe)
 Pushes a keyframe into the queue for a given NeoPixel index. More...
 
void pixelkey_commandproc_init (void)
 Initialize the command processor.
 
void pixelkey_commandproc_task (void)
 Executes queued commands. More...
 
void pixelkey_commandproc_terminal_connected (void)
 Writes the initial device info and terminal prompt when a terminal attach is detected.
 
void pixelkey_commandproc_send_prompt (void)
 Writes the terminal prompt. More...
 
pixelkey_error_t pixelkey_commandproc_push (cmd_t *p_cmd)
 Pushes a command to the processor buffer. More...
 

Detailed Description

PixelKey generic processes.

The PixelKey processes are designed to be processor agnostic. All implementation specific details should be contained in PixelKey HAL.

Enumeration Type Documentation

◆ pixelkey_error_t

PixelKey errors.

Enumerator
PIXELKEY_ERROR_NONE 

Success; no error.

PIXELKEY_ERROR_INVALID_ARGUMENT 

A command argument is invalid.

PIXELKEY_ERROR_BUFFER_FULL 

A buffer is full.

PIXELKEY_ERROR_COMMUNICATION_ERROR 

USB communications error occurred.

PIXELKEY_ERROR_INPUT_BUFFER_OVERFLOW 

USB input buffer has overrun.

PIXELKEY_ERROR_INDEX_OUT_OF_RANGE 

An indexed NeoPixel does not exist.

PIXELKEY_ERROR_KEYFRAME_PROCESSING_STOPPED 

Keyframe processing is stopped.

PIXELKEY_ERROR_RTC_NOT_SET 

System time has not been set.

PIXELKEY_ERROR_NOT_ENOUGH_ARGUMENTS 

Too few arguments are present in a command.

PIXELKEY_ERROR_TOO_MANY_ARGUMENTS 

Too many arguments are present in a command.

PIXELKEY_ERROR_UNKNOWN_COMMAND 

Command is not defined.

PIXELKEY_ERROR_KEY_NOT_FOUND 

Configuration key is invalid.

PIXELKEY_ERROR_NV_MEMORY_ERROR 

An error occurred while accessing NV memory.

PIXELKEY_ERROR_VALUE_OUT_OF_RANGE 

An argument or configuration value is out of range.

PIXELKEY_ERROR_NV_NOT_INITIALIZED 

NV memory has not yet been initialized.

PIXELKEY_ERROR_NV_CRC_MISMATCH 

CRC of configuration struct does not match.

PIXELKEY_ERROR_MISSING_BLOCKS 

Missing firmware upgrade image blocks.

PIXELKEY_ERROR_CRC_MISMATCH 

Firmware upgrade image CRC does not match expected value.

PIXELKEY_ERROR_OUT_OF_MEMORY 

No more memory is available in the heap.

PIXELKEY_ERROR_HAL_ERROR 

An error occurred while changing hardware values.

Function Documentation

◆ pixelkey_commandproc_push()

pixelkey_error_t pixelkey_commandproc_push ( cmd_t p_cmd)

Pushes a command to the processor buffer.

Parameters
[in]p_cmdPointer to the command to queue.
Return values
PIXELKEY_ERROR_BUFFER_FULLNo more space in the command queue.
PIXELKEY_ERROR_NONECommand was pushed to the queue.

◆ pixelkey_commandproc_send_prompt()

void pixelkey_commandproc_send_prompt ( void  )

Writes the terminal prompt.

This is done as a task so that it can execute after all command processing has been completed.

◆ pixelkey_commandproc_task()

void pixelkey_commandproc_task ( void  )

Executes queued commands.

Todo:
Remove this check once all the handlers are implemented.

◆ pixelkey_frameproc_init()

void pixelkey_frameproc_init ( framerate_t  framerate)

Initializes the keyframe processor.

Parameters
framerateThe initial framerate to use.

◆ pixelkey_keyframeproc_framecount_get()

uint32_t pixelkey_keyframeproc_framecount_get ( void  )

Gets the total numbered of rendered frames.

Returns
The framecount.
Note
This value can overflow and wrap back to zero.

◆ pixelkey_keyframeproc_framerate_set()

void pixelkey_keyframeproc_framerate_set ( framerate_t  framerate)

Sets the framerate used to render keyframes.

Parameters
framerateThe framerate to use.

◆ pixelkey_keyframeproc_push()

pixelkey_error_t pixelkey_keyframeproc_push ( uint8_t  index,
keyframe_base_t *  p_keyframe 
)

Pushes a keyframe into the queue for a given NeoPixel index.

Parameters
indexIndex of NeoPixel.
[in]p_keyframePointer to keyframe to push.
Return values
PIXELKEY_ERROR_NONEPush was successful
PIXELKEY_ERROR_INDEX_OUT_OF_RANGEIndex is higher than maximum available NeoPixel.
PIXELKEY_ERROR_BUFFER_FULLBuffer if full for the given NeoPixel queue.

◆ pixelkey_keyframeproc_render_frame()

pixelkey_error_t pixelkey_keyframeproc_render_frame ( color_rgb_t p_frame_buffer)

Performs a render of the current keyframes.

Return values
PIXELKEY_ERROR_NONEFrame render was successful.
Todo:
Add support for scheduled keyframes.