spectrometer 2.0.0.0
|
Functions | |
void | spectrometer_cfg_setup (spectrometer_cfg_t *cfg) |
Config Object Initialization function. | |
SPECTROMETER_RETVAL | spectrometer_init (spectrometer_t *ctx, spectrometer_cfg_t *cfg) |
Initialization function. | |
void | spectrometer_generic_write (spectrometer_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | spectrometer_generic_read (spectrometer_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | spectrometer_pon (spectrometer_t *ctx) |
Set the power on bit function. | |
void | spectrometer_sp_en (spectrometer_t *ctx, uint8_t state) |
Set the spectral measurement enabled bit function. | |
void | spectrometer_smux_en (spectrometer_t *ctx) |
Starting the SMUX function. | |
uint8_t | spectrometer_get_smux_en (spectrometer_t *ctx) |
Reading and Polling the the SMUX Enable bit function. | |
uint8_t | spectrometer_get_data_ready (spectrometer_t *ctx) |
Reading and Polling the the AVALID bit function. | |
void | spectrometer_f1f4_clr_nir (spectrometer_t *ctx) |
SMUX Configuration for F1,F2,F3,F4,NIR,Clear function. | |
void | spectrometer_f5f8_clr_nir (spectrometer_t *ctx) |
SMUX Configuration for F5,F6,F7,F8,NIR,Clear function. | |
void | spectrometer_fd_cfg (spectrometer_t *ctx) |
Flicker Detect Configuration function. | |
void | spectrometer_reg_bank_cfg (spectrometer_t *ctx, uint8_t reg_bank) |
Select Register bank function. | |
void | spectrometer_def_cfg (spectrometer_t *ctx) |
Default configuration function. | |
void | spectrometer_raw_rd_val_mode_1 (spectrometer_t *ctx, uint8_t *adc_data) |
Raw Read Mode 1 function. | |
void | spectrometer_raw_rd_val_mode_2 (spectrometer_t *ctx, uint8_t *adc_data) |
Raw Read Mode 2 function. | |
uint8_t | spectrometer_flicker_detection (spectrometer_t *ctx) |
name function | |
uint8_t | spectrometer_get_int (spectrometer_t *ctx) |
Get Interrupt state function. | |
void spectrometer_cfg_setup | ( | spectrometer_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void spectrometer_def_cfg | ( | spectrometer_t * | ctx | ) |
Default configuration function.
ctx | Click object. |
@description This function is used to apply the default configuration used to demonstrate the usage of the click board.
void spectrometer_f1f4_clr_nir | ( | spectrometer_t * | ctx | ) |
SMUX Configuration for F1,F2,F3,F4,NIR,Clear function.
ctx | Click object. |
@description This function is used to map the individual Photo diodes to dedicated ADCs using SMUX Configuration for F1-F4,Clear,NIR.
void spectrometer_f5f8_clr_nir | ( | spectrometer_t * | ctx | ) |
SMUX Configuration for F5,F6,F7,F8,NIR,Clear function.
ctx | Click object. |
@description This function is used to map the individual Photo diodes to dedicated ADCs using SMUX Configuration for F5-F8,Clear,NIR.
void spectrometer_fd_cfg | ( | spectrometer_t * | ctx | ) |
Flicker Detect Configuration function.
ctx | Click object. |
@description This function is used to map the individual Photo diodes to dedicated ADCs using SMUX Configuration for Flicker detection.
uint8_t spectrometer_flicker_detection | ( | spectrometer_t * | ctx | ) |
name function
ctx | Click object. |
@description This function is used to detect flicker for 100 and 120 Hz.
void spectrometer_generic_read | ( | spectrometer_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void spectrometer_generic_write | ( | spectrometer_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
uint8_t spectrometer_get_data_ready | ( | spectrometer_t * | ctx | ) |
Reading and Polling the the AVALID bit function.
ctx | Click object. |
@description This function is used to read and poll the the AVALID bit in order to check data ready.
uint8_t spectrometer_get_int | ( | spectrometer_t * | ctx | ) |
Get Interrupt state function.
ctx | Click object. |
@description This function is used to check if an interrupt has occured.
uint8_t spectrometer_get_smux_en | ( | spectrometer_t * | ctx | ) |
Reading and Polling the the SMUX Enable bit function.
ctx | Click object. |
@description This function is used to read and poll the the SMUX Enable bit in Enable Register.
SPECTROMETER_RETVAL spectrometer_init | ( | spectrometer_t * | ctx, |
spectrometer_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void spectrometer_pon | ( | spectrometer_t * | ctx | ) |
Set the power on bit function.
ctx | Click object. |
@description This function is used to set the PON (Power on) bit on the chip.
void spectrometer_raw_rd_val_mode_1 | ( | spectrometer_t * | ctx, |
uint8_t * | adc_data ) |
Raw Read Mode 1 function.
ctx | Click object. |
adc_data | Output adc values |
@description This function is used to read out channels with SMUX configration 1; F1-F4, Clear.
void spectrometer_raw_rd_val_mode_2 | ( | spectrometer_t * | ctx, |
uint8_t * | adc_data ) |
Raw Read Mode 2 function.
ctx | Click object. |
adc_data | Output adc values |
@description This function is used to read out channels with SMUX configration 2; F5-F8, Clear.
void spectrometer_reg_bank_cfg | ( | spectrometer_t * | ctx, |
uint8_t | reg_bank ) |
Select Register bank function.
ctx | Click object. |
reg_bank | 8-bit data that defines register bank to address |
@description This function is used to select which Register bank to address.
void spectrometer_smux_en | ( | spectrometer_t * | ctx | ) |
Starting the SMUX function.
ctx | Click object. |
@description This function is used to start the SMUX command by setting the SMUXEN bit in register ENABLE.
void spectrometer_sp_en | ( | spectrometer_t * | ctx, |
uint8_t | state ) |
Set the spectral measurement enabled bit function.
ctx | Click object. |
state | - 1 : spectral measurement enabled bit set - 0 : spectral measurement enabled bit cleared |
@description This function is used to set the SP_EN (spectral measurement enabled) bit on the chip.