spectral  2.0.0.0
Functions
Public function

Functions

void spectral_cfg_setup (spectral_cfg_t *cfg)
 Config Object Initialization function. More...
 
err_t spectral_init (spectral_t *ctx, spectral_cfg_t *cfg)
 Initialization function. More...
 
void spectral_module_reset (spectral_t *ctx)
 Reset module. More...
 
void spectral_uart_write (spectral_t *ctx, uint8_t *data_buf, uint16_t len)
 Generic write function. More...
 
int32_t spectral_uart_read (spectral_t *ctx, uint8_t *data_buf, uint16_t max_len)
 Generic read function. More...
 
void spectral_send_command (spectral_t *ctx, uint8_t *command)
 Send Command. More...
 
void spectral_get_color_data (uint8_t *rsp, uint8_t *xyz_data)
 Read calibrated X, Y, and Z color data. More...
 
void spectral_get_xyz_data (uint8_t *rsp, uint8_t *xyzr_data)
 Read raw X, Y, and Z data. More...
 
void spectral_get_xy_small_data (uint8_t *rsp, uint8_t *xy_data)
 Read calibrated x and y for CIE 1931 color gamut. More...
 
uint8_t spectral_get_lux_data (uint8_t *rsp)
 Read the calibrated LUX value from the sensor. More...
 
uint8_t spectral_get_cct_data (uint8_t *rsp)
 Read the calibrated CCT value from the sensor. More...
 
void spectral_get_uv_data (uint8_t *rsp, uint16_t *uv_data)
 Read calibrated u�, v� and u, v for CIE 1976 color gamut. More...
 
void spectral_get_data (uint8_t *rsp, uint16_t *c_data)
 Read raw X, Y, Z and NIR data as well as two special internal registers D, & C. More...
 
uint8_t spectral_get_duv_data (uint8_t *rsp)
 Read calibrated Duv for CIE 1976-color gamut. More...
 

Detailed Description

Function Documentation

◆ spectral_cfg_setup()

void spectral_cfg_setup ( spectral_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ spectral_get_cct_data()

uint8_t spectral_get_cct_data ( uint8_t *  rsp)

Read the calibrated CCT value from the sensor.

Parameters
rsppointer to buffer
Returns
cct value

◆ spectral_get_color_data()

void spectral_get_color_data ( uint8_t *  rsp,
uint8_t *  xyz_data 
)

Read calibrated X, Y, and Z color data.

Parameters
rsppointer to buffer
xyz_datapointer to the buffer in which will be written

◆ spectral_get_data()

void spectral_get_data ( uint8_t *  rsp,
uint16_t *  c_data 
)

Read raw X, Y, Z and NIR data as well as two special internal registers D, & C.

Parameters
rsppointer to buffer
c_datapointer to the buffer in which will be written

◆ spectral_get_duv_data()

uint8_t spectral_get_duv_data ( uint8_t *  rsp)

Read calibrated Duv for CIE 1976-color gamut.

Parameters
rsppointer to buffer
Returns
duv value

◆ spectral_get_lux_data()

uint8_t spectral_get_lux_data ( uint8_t *  rsp)

Read the calibrated LUX value from the sensor.

Parameters
rsppointer to buffer
Returns
lux value

◆ spectral_get_uv_data()

void spectral_get_uv_data ( uint8_t *  rsp,
uint16_t *  uv_data 
)

Read calibrated u�, v� and u, v for CIE 1976 color gamut.

Parameters
rsppointer to buffer
uv_datapointer to the buffer in which will be written

◆ spectral_get_xy_small_data()

void spectral_get_xy_small_data ( uint8_t *  rsp,
uint8_t *  xy_data 
)

Read calibrated x and y for CIE 1931 color gamut.

Parameters
rsppointer to buffer
xy_datapointer to the buffer in which will be written

◆ spectral_get_xyz_data()

void spectral_get_xyz_data ( uint8_t *  rsp,
uint8_t *  xyzr_data 
)

Read raw X, Y, and Z data.

Parameters
rsppointer to buffer
xyzr_datapointer to the buffer in which will be written

◆ spectral_init()

err_t spectral_init ( spectral_t ctx,
spectral_cfg_t cfg 
)

Initialization function.

Parameters
spectralClick object.
cfgClick configuration structure.

This function initializes all necessary pins and peripherals used for this click.

◆ spectral_module_reset()

void spectral_module_reset ( spectral_t ctx)

Reset module.

Parameters
spectralClick object.

◆ spectral_send_command()

void spectral_send_command ( spectral_t ctx,
uint8_t *  command 
)

Send Command.

Parameters
commandpointer to command string

◆ spectral_uart_read()

int32_t spectral_uart_read ( spectral_t ctx,
uint8_t *  data_buf,
uint16_t  max_len 
)

Generic read function.

Parameters
spectralClick object.
data_bufData buffer for read data.
max_lenThe maximum length of data that can be read.
Returns
Number of reads data.

◆ spectral_uart_write()

void spectral_uart_write ( spectral_t ctx,
uint8_t *  data_buf,
uint16_t  len 
)

Generic write function.

Parameters
spectralClick object.
data_bufData buffer for sends.
lenNumber of bytes for sends.