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.
 

Detailed Description

Function Documentation

◆ spectrometer_cfg_setup()

void spectrometer_cfg_setup ( spectrometer_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ spectrometer_def_cfg()

void spectrometer_def_cfg ( spectrometer_t * ctx)

Default configuration function.

Parameters
ctxClick object.

@description This function is used to apply the default configuration used to demonstrate the usage of the click board.

◆ spectrometer_f1f4_clr_nir()

void spectrometer_f1f4_clr_nir ( spectrometer_t * ctx)

SMUX Configuration for F1,F2,F3,F4,NIR,Clear function.

Parameters
ctxClick object.

@description This function is used to map the individual Photo diodes to dedicated ADCs using SMUX Configuration for F1-F4,Clear,NIR.

◆ spectrometer_f5f8_clr_nir()

void spectrometer_f5f8_clr_nir ( spectrometer_t * ctx)

SMUX Configuration for F5,F6,F7,F8,NIR,Clear function.

Parameters
ctxClick object.

@description This function is used to map the individual Photo diodes to dedicated ADCs using SMUX Configuration for F5-F8,Clear,NIR.

◆ spectrometer_fd_cfg()

void spectrometer_fd_cfg ( spectrometer_t * ctx)

Flicker Detect Configuration function.

Parameters
ctxClick object.

@description This function is used to map the individual Photo diodes to dedicated ADCs using SMUX Configuration for Flicker detection.

◆ spectrometer_flicker_detection()

uint8_t spectrometer_flicker_detection ( spectrometer_t * ctx)

name function

Parameters
ctxClick object.
Returns
result 8-bit status from FD_Status register

@description This function is used to detect flicker for 100 and 120 Hz.

◆ spectrometer_generic_read()

void spectrometer_generic_read ( spectrometer_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ spectrometer_generic_write()

void spectrometer_generic_write ( spectrometer_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ spectrometer_get_data_ready()

uint8_t spectrometer_get_data_ready ( spectrometer_t * ctx)

Reading and Polling the the AVALID bit function.

Parameters
ctxClick object.
Returns
1 : Data ready, 0 : Data not ready

@description This function is used to read and poll the the AVALID bit in order to check data ready.

◆ spectrometer_get_int()

uint8_t spectrometer_get_int ( spectrometer_t * ctx)

Get Interrupt state function.

Parameters
ctxClick object.
Returns
1 : Interrupt has not occured, 0 : Interrupt has occured

@description This function is used to check if an interrupt has occured.

◆ spectrometer_get_smux_en()

uint8_t spectrometer_get_smux_en ( spectrometer_t * ctx)

Reading and Polling the the SMUX Enable bit function.

Parameters
ctxClick object.
Returns
1 : SMUX operation is not finished, 0 : SMUX operation is finished

@description This function is used to read and poll the the SMUX Enable bit in Enable Register.

◆ spectrometer_init()

SPECTROMETER_RETVAL spectrometer_init ( spectrometer_t * ctx,
spectrometer_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ spectrometer_pon()

void spectrometer_pon ( spectrometer_t * ctx)

Set the power on bit function.

Parameters
ctxClick object.

@description This function is used to set the PON (Power on) bit on the chip.

Note
Function clears the PON bit in ENABLE register and keeps the other bits.

◆ spectrometer_raw_rd_val_mode_1()

void spectrometer_raw_rd_val_mode_1 ( spectrometer_t * ctx,
uint8_t * adc_data )

Raw Read Mode 1 function.

Parameters
ctxClick object.
adc_dataOutput adc values

@description This function is used to read out channels with SMUX configration 1; F1-F4, Clear.

◆ spectrometer_raw_rd_val_mode_2()

void spectrometer_raw_rd_val_mode_2 ( spectrometer_t * ctx,
uint8_t * adc_data )

Raw Read Mode 2 function.

Parameters
ctxClick object.
adc_dataOutput adc values

@description This function is used to read out channels with SMUX configration 2; F5-F8, Clear.

◆ spectrometer_reg_bank_cfg()

void spectrometer_reg_bank_cfg ( spectrometer_t * ctx,
uint8_t reg_bank )

Select Register bank function.

Parameters
ctxClick object.
reg_bank8-bit data that defines register bank to address

@description This function is used to select which Register bank to address.

Note
reg_bank bit(4) is set to '1' for setting the 0x00-0x7f.

◆ spectrometer_smux_en()

void spectrometer_smux_en ( spectrometer_t * ctx)

Starting the SMUX function.

Parameters
ctxClick object.

@description This function is used to start the SMUX command by setting the SMUXEN bit in register ENABLE.

Note
The SMUXEN bit gets cleared automatically as soon as SMUX operation is finished.

◆ spectrometer_sp_en()

void spectrometer_sp_en ( spectrometer_t * ctx,
uint8_t state )

Set the spectral measurement enabled bit function.

Parameters
ctxClick 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.