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

Functions

config_api_t const * config (void)
 Get a pointer to the current API instance. More...
 
config_data_t const * config_default (void)
 Get a pointer to the default configuration values. More...
 
config_data_t const * config_get_or_default (void)
 Gets a pointer to the saved configuration values or the defaults if an error occurs. More...
 
void config_register (config_api_t const *p_instance)
 Register an API to be used as the current instance. More...
 
pixelkey_error_t config_validate (void)
 Validates and updates NV memory config if needed; can only be called after config_register.
 

Variables

static config_api_t const * registered_api = NULL
 Currently registered API instance.
 
static config_data_t const config_data_default
 Default configuration data. More...
 

Detailed Description

Function Documentation

◆ config()

config_api_t const * config ( void  )

Get a pointer to the current API instance.

Returns
pointer to instance.

◆ config_default()

config_data_t const * config_default ( void  )

Get a pointer to the default configuration values.

Returns
default config pointer.

◆ config_get_or_default()

config_data_t const * config_get_or_default ( void  )
inline

Gets a pointer to the saved configuration values or the defaults if an error occurs.

Returns
Pointer to saved config or default values.

◆ config_register()

void config_register ( config_api_t const *  p_instance)

Register an API to be used as the current instance.

Parameters
[in]p_instancePointer to the API instance.

Variable Documentation

◆ config_data_default

config_data_t const config_data_default
static
Initial value:
=
{
.header =
{
.version = (1) ,
.length = sizeof(config_data_t),
.crc = UINT16_MAX,
},
.flags_b =
{
.echo_enabled = PIXELKEY_DEFAULT_COM_ECHO,
.gamma_enabled = !PIXELKEY_DISABLE_GAMMA_CORRECTION,
},
.gamma_factor = (2.8f) ,
.framerate = PIXELKEY_DEFAULT_FRAMERATE,
.num_neopixels = PIXELKEY_NEOPIXEL_COUNT,
.max_rgb_value = UINT8_MAX,
.neopixel_phy =
{
.frequency_khz = PIXELKEY_DEFAULT_PHY_FREQUENCY,
.duty_cycle_b0 = PIXELKEY_DEFAULT_PHY_B0,
.duty_cycle_b1 = PIXELKEY_DEFAULT_PHY_B1,
},
}
#define PIXELKEY_NEOPIXEL_COUNT
Number of NeoPixels present on the PCB.
Definition: hal_device.h:16
Configuration structure.
Definition: config.h:40

Default configuration data.