spectral2 2.0.0.0
|
Functions | |
void | spectral2_cfg_setup (spectral2_cfg_t *cfg) |
Config Object Initialization function. | |
SPECTRAL2_RETVAL | spectral2_init (spectral2_t *ctx, spectral2_cfg_t *cfg) |
Initialization function. | |
void | spectral2_default_cfg (spectral2_t *ctx) |
Click Default Configuration function. | |
void | spectral2_generic_write (spectral2_t *ctx, uint8_t reg, uint8_t data_buf) |
Generic write function. | |
uint8_t | spectral2_generic_read (spectral2_t *ctx, uint8_t reg) |
Generic read function. | |
void | spectral2_reset (spectral2_t *ctx) |
Reset function. | |
void | spectral2_set_integration_time (spectral2_t *ctx, uint8_t cur_time) |
Integration time function. | |
uint8_t | spectral2_get_temperature (spectral2_t *ctx) |
Read temperature function. | |
void | spectral2_led_control (spectral2_t *ctx, uint8_t led_data) |
Led ctrl and setting function. | |
int16_t | spectral2_get_data (spectral2_t *ctx, uint8_t data_reg) |
Read data function. | |
int32_t | spectral2_get_calibrated_data (spectral2_t *ctx, uint8_t data_reg) |
Reads calibrated data function. | |
void spectral2_cfg_setup | ( | spectral2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void spectral2_default_cfg | ( | spectral2_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Spectral2 click.
Function for configuration measurements
ctx | Click object. |
Options for Configuration:
Soft Reset ( 0 - automatically after the reset / 1 - soft reset ) Enable interrupt pin output ( 1 - Enable / 0 - Disable ) Sensor Channel Gain Setting ( 1x, 3.7x, 16x or 64x) Data Conversion Type:Mode 0 - reads V, B, G and Y data Mode 1 - reads G, Y, O and R data Mode 2 - reads all data Mode 3 - reads V, B, G, Y, O and R in One-Shot mode
uint8_t spectral2_generic_read | ( | spectral2_t * | ctx, |
uint8_t | reg ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
@description This function reads data from the desired register.
void spectral2_generic_write | ( | spectral2_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_buf ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data to be written. |
@description This function writes data to the desired register.
int32_t spectral2_get_calibrated_data | ( | spectral2_t * | ctx, |
uint8_t | data_reg ) |
Reads calibrated data function.
ctx | Click object. |
dataReg | Value from which the filter will be read. |
@description Function reads the calibrated data.
int16_t spectral2_get_data | ( | spectral2_t * | ctx, |
uint8_t | data_reg ) |
Read data function.
ctx | Click object. |
dataReg | Value from which the filter will be read. |
@description Function for reading the measured data.
uint8_t spectral2_get_temperature | ( | spectral2_t * | ctx | ) |
Read temperature function.
ctx | Click object. |
@description Function for reading device temperature.
SPECTRAL2_RETVAL spectral2_init | ( | spectral2_t * | ctx, |
spectral2_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 spectral2_led_control | ( | spectral2_t * | ctx, |
uint8_t | led_data ) |
Led ctrl and setting function.
ctx | Click object. |
led_data | Data that will be written in the LED control register. |
@description Function for led control and settings led.
LED_DRV current limit ( 12.5mA, 25mA, 50mA or 100mA ) Enable LED_DRV ( 1 - Enable / 0 - Disable ) LED_IND current limit ( 1mA, 2mA, 4mA or 8mA ) Enable LED_IND ( 1 - Enable / 0 - Disable )
void spectral2_reset | ( | spectral2_t * | ctx | ) |
Reset function.
ctx | Click object. |
@description This function resets the chip.
void spectral2_set_integration_time | ( | spectral2_t * | ctx, |
uint8_t | cur_time ) |
Integration time function.
ctx | Click object. |
cur_time | Data that will be written in the integration time register. |
@description Function for calculating integration time.
* 2.8ms (default 0xFF)