irsense 2.0.0.0
|
Functions | |
void | irsense_cfg_setup (irsense_cfg_t *cfg) |
Config Object Initialization function. | |
IRSENSE_RETVAL | irsense_init (irsense_t *ctx, irsense_cfg_t *cfg) |
Initialization function. | |
void | irsense_generic_write (irsense_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | irsense_generic_read (irsense_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | irsense_write_byte (irsense_t *ctx, uint8_t reg_address, uint8_t write_data) |
Generic write the byte of data function. | |
uint8_t | irsense_read_byte (irsense_t *ctx, uint8_t reg_address) |
Generic read the byte of data function. | |
uint16_t | irsense_read_data (irsense_t *ctx, uint8_t reg_address_low) |
Generic read 16-bit of data function. | |
void | irsense_power_on (irsense_t *ctx) |
Enable the sensor function. | |
void | irsense_power_off (irsense_t *ctx) |
Disable the sensor function. | |
uint8_t | irsense_get_company_code (irsense_t *ctx) |
Get company code function. | |
uint8_t | irsense_get_device_id (irsense_t *ctx) |
Get device ID function. | |
uint8_t | irsense_read_interrupt_status (irsense_t *ctx) |
Get interrupts activate or inactivate corresponding status value function. | |
uint8_t | irsense_get_status (irsense_t *ctx) |
Get status value function. | |
void | irsense_set_configuration (irsense_t *ctx, uint8_t register_value) |
Set configuration function. | |
void | irsense_set_mode (irsense_t *ctx, uint8_t mode) |
Set the mode function. | |
void | irsense_set_cutoff_frequency (irsense_t *ctx, uint8_t frequency) |
Set the cutoff frequency function. | |
uint8_t | irsense_check_available (irsense_t *ctx) |
Checks to see if DRDY flag is set in the status register function. | |
uint8_t | irsense_check_overrun (irsense_t *ctx) |
Checks to see if data overrun flag is set in the status register function. | |
void | irsense_soft_reset (irsense_t *ctx) |
Soft reset function. | |
void | irsense_refresh (irsense_t *ctx) |
Refresh by read dummy data function. | |
int16_t | irsense_get_ir1 (irsense_t *ctx) |
Get value of sensor channel 1 function. | |
int16_t | irsense_get_ir2 (irsense_t *ctx) |
Get value of sensor channel 2 function. | |
int16_t | irsense_get_ir3 (irsense_t *ctx) |
Get value of sensor channel 3 function. | |
int16_t | irsense_get_ir4 (irsense_t *ctx) |
Get value of sensor channel 4 function. | |
void | irsense_get_ir_sense (irsense_t *ctx, irsense_ir_data_t *ir_data) |
Get value of sensor all channels function. | |
float | irsense_get_temperature (irsense_t *ctx) |
Get the temperature in degrees Celsius function. | |
float | irsense_get_temperature_f (irsense_t *ctx) |
Get the temperature in Fahrenheit degrees function. | |
void | irsense_set_threshold_ir2_ir4 (irsense_t *ctx, uint8_t value) |
Set high or low threshold for channel 2 and channel 4 ( Ir2-Ir4 ) function. | |
uint16_t | irsense_get_threshold_ir2_ir4 (irsense_t *ctx) |
Get threshold value for channel 2 and channel 4 ( Ir2-Ir4 ) function. | |
void | irsense_set_threshold_eeprom_ir2_ir4 (irsense_t *ctx, uint8_t value) |
Set high or low EEPROM threshold for channel 2 and channel 4 ( Ir2-Ir4 ) function. | |
void | irsense_set_threshold_ir1_ir3 (irsense_t *ctx, uint8_t value) |
Set high or low threshold for channel 1 and channel 3 ( Ir1-Ir3 ) function. | |
uint16_t | irsense_get_threshold_ir1_ir3 (irsense_t *ctx) |
Get threshold value for channel 1 and channel 3 ( Ir1-Ir3 ) function. | |
void | irsense_set_threshold_eeprom_ir1_ir3 (irsense_t *ctx, uint8_t value) |
Set high or low EEPROM threshold for channel 1 and channel 3 ( Ir1-Ir3 ) function. | |
void | irsense_read_threshold (irsense_t *ctx, irsense_reg_t *reg) |
Get threshold value for all channels function. | |
void | irsense_read_threshold_eeprom (irsense_t *ctx, irsense_eeprom_t *eeprom) |
Get threshold EEPROM value for all channels function. | |
void | irsense_set_hysteresis_ir2_ir4 (irsense_t *ctx, uint8_t value) |
Set hysteresis setting of threshold level for channel 2 and channel 4 ( Ir2-Ir4 ) function. | |
void | irsense_set_hysteresis_eeprom_ir2_ir4 (irsense_t *ctx, uint8_t value) |
Set hysteresis EEPROM setting of threshold level for channel 2 and channel 4 ( Ir2-Ir4 ) function. | |
void | irsense_set_hysteresis_ir1_ir3 (irsense_t *ctx, uint8_t value) |
Set hysteresis setting of threshold level for channel 1 and channel 3 ( Ir1-Ir3 ) function. | |
void | irsense_set_hysteresis_eeprom_ir1_ir3 (irsense_t *ctx, uint8_t value) |
Set hysteresis EEPROM setting of threshold level for channel 1 and channel 3 ( Ir1-Ir3 ) function. | |
void | irsense_read_hysteresis (irsense_t *ctx, uint8_t *ehys24, uint8_t *ehys13) |
Get Hysteresis value for all channes function. | |
void | irsense_read_hysteresis_eeprom (irsense_t *ctx, uint8_t *eehys24, uint8_t *eehys13) |
Get Hysteresis EEPROM value for all channes function. | |
void | irsense_set_interrupts_reg (irsense_t *ctx, irsense_eint_t *eint) |
Sets interrupts activate or inactivate corresponding function. | |
void | irsense_enable_data_ready_interrupt (irsense_t *ctx) |
Sets interrupts source settings function. | |
uint8_t | irsense_check_int_states (irsense_t *ctx) |
Check state of INT pin function. | |
void irsense_cfg_setup | ( | irsense_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t irsense_check_available | ( | irsense_t * | ctx | ) |
Checks to see if DRDY flag is set in the status register function.
ctx | Click object. |
@description Function checks to see if DRDY flag is set in the status register by read DRDY bit from the target IRSENSE_REG_ST1 register address of AK9750 sensor on IR Sense click board.
uint8_t irsense_check_int_states | ( | irsense_t * | ctx | ) |
Check state of INT pin function.
ctx | Click object. |
@description Function check state of INT pin of AK9750 sensor on IR Sense click board.
uint8_t irsense_check_overrun | ( | irsense_t * | ctx | ) |
Checks to see if data overrun flag is set in the status register function.
ctx | Click object. |
@description Function checks to see if overrun flag is set in the status register by read overrun bit from the target IRSENSE_REG_ST1 register address of AK9750 sensor on IR Sense click board.
void irsense_enable_data_ready_interrupt | ( | irsense_t * | ctx | ) |
Sets interrupts source settings function.
ctx | Click object. |
@description Function sets interrupts activate or inactivate corresponding by write activate data ready interrupt setting bit to the target IRSENSE_REG_EINTEN of AK9750 sensor on IR Sense click board.
void irsense_generic_read | ( | irsense_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 irsense_generic_write | ( | irsense_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 irsense_get_company_code | ( | irsense_t * | ctx | ) |
Get company code function.
ctx | Click object. |
@description Function get company code by read 8-bit data from the target _IRSENSE_REG_WIA1 register address of AK9750 sensor on IR Sense click board.
uint8_t irsense_get_device_id | ( | irsense_t * | ctx | ) |
Get device ID function.
ctx | Click object. |
@description Function get device ID by read 8-bit data from the target IRSENSE_REG_WIA2 register address of AK9750 sensor on IR Sense click board.
int16_t irsense_get_ir1 | ( | irsense_t * | ctx | ) |
Get value of sensor channel 1 function.
ctx | Click object. |
@description Function get value of sensor channel 1 by read value from the two target IRSENSE_REG_IR1_LOW and IRSENSE_REG_IR1_HIGH register address of AK9750 sensor on IR Sense click board.
int16_t irsense_get_ir2 | ( | irsense_t * | ctx | ) |
Get value of sensor channel 2 function.
ctx | Click object. |
@description Function get value of sensor channel 2 by read value from the two target IRSENSE_REG_IR2_LOW and IRSENSE_REG_IR2_HIGH register address of AK9750 sensor on IR Sense click board.
int16_t irsense_get_ir3 | ( | irsense_t * | ctx | ) |
Get value of sensor channel 3 function.
ctx | Click object. |
@description Function get value of sensor channel 3 by read value from the two target IRSENSE_REG_IR3_LOW and IRSENSE_REG_IR3_HIGH register address of AK9750 sensor on IR Sense click board.
int16_t irsense_get_ir4 | ( | irsense_t * | ctx | ) |
Get value of sensor channel 4 function.
ctx | Click object. |
@description Function get value of sensor channel 4 by read value from the two target IRSENSE_REG_IR4_LOW and IRSENSE_REG_IR4_HIGH register address of AK9750 sensor on IR Sense click board.
void irsense_get_ir_sense | ( | irsense_t * | ctx, |
irsense_ir_data_t * | ir_data ) |
Get value of sensor all channels function.
ctx | Click object. |
ir_data | IR data (1,2,3,4). |
@description Function get value of sensor all channels by read values from the target IRSENSE_REG_IR1_LOW, IRSENSE_REG_IR1_HIGH, IRSENSE_REG_IR1_LOW, IRSENSE_REG_IR1_HIGH, IRSENSE_REG_IR2_LOW, IRSENSE_REG_IR2_HIGH, IRSENSE_REG_IR3_LOW, IRSENSE_REG_IR3_HIGH, IRSENSE_REG_IR4_LOW and IRSENSE_REG_IR4_HIGH register address of AK9750 sensor on IR Sense click board.
uint8_t irsense_get_status | ( | irsense_t * | ctx | ) |
Get status value function.
ctx | Click object. |
@description Function get status value by read 8-bit data from the target IRSENSE_REG_ST1 register address of AK9750 sensor on IR Sense click board.
float irsense_get_temperature | ( | irsense_t * | ctx | ) |
Get the temperature in degrees Celsius function.
ctx | Click object. |
@description Function get the temperature float value by read the measurement data from the two target IRSENSE_REG_TMP_LOW and IRSENSE_REG_TMP_HIGH register address of AK9750 sensor on IR Sense click board calculate temperature value to degree Celsius [ �C ].
float irsense_get_temperature_f | ( | irsense_t * | ctx | ) |
Get the temperature in Fahrenheit degrees function.
ctx | Click object. |
@description Function get the temperature float value by read the measurement data from the two target IRSENSE_REG_TMP_LOW and IRSENSE_REG_TMP_HIGH register address of AK9750 sensor on IR Sense click board calculate temperature value to Fahrenheit degrees [ �F ].
uint16_t irsense_get_threshold_ir1_ir3 | ( | irsense_t * | ctx | ) |
Get threshold value for channel 1 and channel 3 ( Ir1-Ir3 ) function.
ctx | Click object. |
@description Function get threshold level setting value for channel 1 and channel 3 ( Ir1-Ir3 ) by read 16-bit value to the two target _IRSENSE_REG_ETH13H_LOW and _IRSENSE_REG_ETH13H_HIGH of AK9750 sensor on IR Sense click board.
uint16_t irsense_get_threshold_ir2_ir4 | ( | irsense_t * | ctx | ) |
Get threshold value for channel 2 and channel 4 ( Ir2-Ir4 ) function.
ctx | Click object. |
@description Function get threshold level setting value for channel 2 and channel 4 ( Ir2-Ir4 ) by read 16-bit value to the two target IRSENSE_REG_ETH24H_LOW and IRSENSE_REG_ETH24H_HIGH of AK9750 sensor on IR Sense click board.
IRSENSE_RETVAL irsense_init | ( | irsense_t * | ctx, |
irsense_cfg_t * | cfg ) |
Initialization function.
irsense | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void irsense_power_off | ( | irsense_t * | ctx | ) |
Disable the sensor function.
ctx | Click object. |
@description Function disable the sensor by clear state of CS pin of AK9750 sensor on IR Sense click board.
void irsense_power_on | ( | irsense_t * | ctx | ) |
Enable the sensor function.
ctx | Click object. |
@description Function enable the sensor by set state of CS pin of AK9750 sensor on IR Sense click board.
uint8_t irsense_read_byte | ( | irsense_t * | ctx, |
uint8_t | reg_address ) |
Generic read the byte of data function.
ctx | Click object. |
reg_address | Register address. |
@description Function read the 8-bit data from the target 8-bit register address of AK9750 sensor on IR Sense click board.
uint16_t irsense_read_data | ( | irsense_t * | ctx, |
uint8_t | reg_address_low ) |
Generic read 16-bit of data function.
ctx | Click object. |
reg_address_low | Low register address. |
@description Function read the 16-bit data from the two target 8-bit register address of AK9750 sensor on IR Sense click board.
void irsense_read_hysteresis | ( | irsense_t * | ctx, |
uint8_t * | ehys24, | ||
uint8_t * | ehys13 ) |
Get Hysteresis value for all channes function.
ctx | Click object. |
ehys24 | pointer to 8-bit ( Ir2-Ir4 ) hysteresis setting of threshold level value. |
ehys13 | pointer to 8-bit ( Ir1-Ir3 ) hysteresis setting of threshold level value. |
@description Function get hysteresis setting of threshold level value for all channels by read all hysteresis setting of threshold level value from all target registers of AK9750 sensor on IR Sense click board.
void irsense_read_hysteresis_eeprom | ( | irsense_t * | ctx, |
uint8_t * | eehys24, | ||
uint8_t * | eehys13 ) |
Get Hysteresis EEPROM value for all channes function.
ctx | Click object. |
eehys24 | pointer to 8-bit ( Ir2-Ir4 ) hysteresis EEPROM setting of threshold level value. |
eehys13 | pointer to 8-bit ( Ir1-Ir3 ) hysteresis EEPROM setting of threshold level value. |
@description Function get hysteresis EEPROM setting of threshold level value for all channels by read all hysteresis EEPROM setting of threshold level value from all target registers of AK9750 sensor on IR Sense click board.
uint8_t irsense_read_interrupt_status | ( | irsense_t * | ctx | ) |
Get interrupts activate or inactivate corresponding status value function.
ctx | Click object. |
@description Function get interrupts activate or inactivate corresponding status by read 8-bit data from the target _IRSENSE_REG_INTST register address of AK9750 sensor on IR Sense click board.
void irsense_read_threshold | ( | irsense_t * | ctx, |
irsense_reg_t * | reg ) |
Get threshold value for all channels function.
ctx | Click object. |
reg | Register address. |
@description Function get threshold level setting value for all channels by read all threshold level setting value from all target registers of AK9750 sensor on IR Sense click board.
void irsense_read_threshold_eeprom | ( | irsense_t * | ctx, |
irsense_eeprom_t * | eeprom ) |
Get threshold EEPROM value for all channels function.
ctx | Click object. |
eeth24h | pointer to 16-bit ( High Ir2-Ir4 ) EEPROM value. |
eeth24l | pointer to 16-bit ( Low Ir2-Ir4 ) EEPROM value. |
eeth13h | pointer to 16-bit ( High Ir1-Ir3 ) EEPROM value. |
eeth13l | pointer to 16-bit ( Low Ir1-Ir3 ) EEPROM value. |
@description Function get threshold EEPROM level setting value for all channels by read all threshold EEPROM level setting value from all target registers of AK9750 sensor on IR Sense click board.
void irsense_refresh | ( | irsense_t * | ctx | ) |
Refresh by read dummy data function.
ctx | Click object. |
@description Function refresh by read dummy data by read data from the target IRSENSE_REG_ST2 register address of AK9750 sensor on IR Sense click board.
void irsense_set_configuration | ( | irsense_t * | ctx, |
uint8_t | register_value ) |
Set configuration function.
ctx | Click object. |
registerValue | 8-bit interrupts status value:
|
@description Function set configuration by write 8-bit registerValue to the target IRSENSE_REG_ECNTL1 register address of AK9750 sensor on IR Sense click board.
void irsense_set_cutoff_frequency | ( | irsense_t * | ctx, |
uint8_t | frequency ) |
Set the cutoff frequency function.
ctx | Click object. |
frequency | 8-bit mode value [ bit5 : bit3 ] :
|
@description Function set the cutoff frequency by write 8-bit mode to the target _IRSENSE_REG_ECNTL1 register address of AK9750 sensor on IR Sense click board.
void irsense_set_hysteresis_eeprom_ir1_ir3 | ( | irsense_t * | ctx, |
uint8_t | value ) |
Set hysteresis EEPROM setting of threshold level for channel 1 and channel 3 ( Ir1-Ir3 ) function.
ctx | Click object. |
value | 8-bit hysteresis setting of threshold level value for channel 1 and channel 3. Number of the bytes to be read |
@description Function set hysteresis EEPROM setting of threshold level value for channel 1 and channel 3 ( Ir1-Ir3 ) by write 8-bit hysteresis EEPROM value to the target IRSENSE_EEPROM_MAP_EHYS13 of AK9750 sensor on IR Sense click board.
void irsense_set_hysteresis_eeprom_ir2_ir4 | ( | irsense_t * | ctx, |
uint8_t | value ) |
Set hysteresis EEPROM setting of threshold level for channel 2 and channel 4 ( Ir2-Ir4 ) function.
ctx | Click object. |
value | 8-bit hysteresis setting of threshold level value for channel 2 and channel 4. |
@description Function set hysteresis EEPROM setting of threshold level value for channel 2 and channel 4 ( Ir2-Ir4 ) by write 8-bit hysteresis EEPROM value to the target IRSENSE_EEPROM_MAP_EHYS24 of AK9750 sensor on IR Sense click board.
void irsense_set_hysteresis_ir1_ir3 | ( | irsense_t * | ctx, |
uint8_t | value ) |
Set hysteresis setting of threshold level for channel 1 and channel 3 ( Ir1-Ir3 ) function.
ctx | Click object. |
value | 8-bit hysteresis setting of threshold level value for channel 1 and channel 3. |
@description Function set hysteresis setting of threshold level value for channel 1 and channel 3 ( Ir1-Ir3 ) by write 8-bit hysteresis value to the target IRSENSE_REG_EHYS13 of AK9750 sensor on IR Sense click board.
void irsense_set_hysteresis_ir2_ir4 | ( | irsense_t * | ctx, |
uint8_t | value ) |
Set hysteresis setting of threshold level for channel 2 and channel 4 ( Ir2-Ir4 ) function.
ctx | Click object. |
value | 8-bit hysteresis setting of threshold level value for channel 2 and channel 4. |
@description Function set hysteresis setting of threshold level value for channel 2 and channel 4 ( Ir2-Ir4 ) by write 8-bit hysteresis value to the target IRSENSE_REG_EHYS24 of AK9750 sensor on IR Sense click board.
void irsense_set_interrupts_reg | ( | irsense_t * | ctx, |
irsense_eint_t * | eint ) |
Sets interrupts activate or inactivate corresponding function.
ctx | Click object. |
eint | Enable interrupt. |
@description Function sets interrupts activate or inactivate corresponding by write interrupts activate value to the target IRSENSE_REG_EINTEN of AK9750 sensor on IR Sense click board.
void irsense_set_mode | ( | irsense_t * | ctx, |
uint8_t | mode ) |
Set the mode function.
ctx | Click object. |
mode | 8-bit mode value [ bit2 : bit0 ] :
|
@description Function set the mode by write 8-bit mode to the target IRSENSE_REG_ECNTL1 register address of AK9750 sensor on IR Sense click board.
void irsense_set_threshold_eeprom_ir1_ir3 | ( | irsense_t * | ctx, |
uint8_t | value ) |
Set high or low EEPROM threshold for channel 1 and channel 3 ( Ir1-Ir3 ) function.
ctx | Click object. |
value | 8-bit threshold value for channel 1 and channel 3. |
@description Function set high or low EEPROM threshold level setting for channel 1 and channel 3 ( Ir1-Ir3 ) by write 8-bit value to the two target _IRSENSE_REG_ETH13H_LOW and _IRSENSE_REG_ETH13H_HIGH of AK9750 sensor on IR Sense click board.
void irsense_set_threshold_eeprom_ir2_ir4 | ( | irsense_t * | ctx, |
uint8_t | value ) |
Set high or low EEPROM threshold for channel 2 and channel 4 ( Ir2-Ir4 ) function.
ctx | Click object. |
value | 8-bit threshold value for channel 2 and channel 4. |
@description Function set high or low EEPROM threshold level setting for channel 2 and channel 4 ( Ir2-Ir4 ) by write 8-bit value to the two target _IRSENSE_REG_ETH24H_LOW and _IRSENSE_REG_ETH24H_HIGH of AK9750 sensor on IR Sense click board.
void irsense_set_threshold_ir1_ir3 | ( | irsense_t * | ctx, |
uint8_t | value ) |
Set high or low threshold for channel 1 and channel 3 ( Ir1-Ir3 ) function.
ctx | Click object. |
value | 8-bit threshold value for channel 1 and channel 3. |
@description Function set high or low threshold level setting for channel 1 and channel 3 ( Ir1-Ir3 ) by write 8-bit value to the two target _IRSENSE_REG_ETH13H_LOW and _IRSENSE_REG_ETH13H_HIGH of AK9750 sensor on IR Sense click board.
void irsense_set_threshold_ir2_ir4 | ( | irsense_t * | ctx, |
uint8_t | value ) |
Set high or low threshold for channel 2 and channel 4 ( Ir2-Ir4 ) function.
ctx | Click object. |
value | 8-bit threshold value for channel 2 and channel 4. |
@description Function set high or low threshold level setting for channel 2 and channel 4 ( Ir2-Ir4 ) by write 8-bit value to the two target IRSENSE_REG_ETH24H_LOW and IRSENSE_REG_ETH24H_HIGH of AK9750 sensor on IR Sense click board.
void irsense_soft_reset | ( | irsense_t * | ctx | ) |
Soft reset function.
ctx | Click object. |
@description Function soft reset by sets Soft Reset bit ( write 0x01 ) to the target IRSENSE_REG_CNTL2 register address of AK9750 sensor on IR Sense click board.
void irsense_write_byte | ( | irsense_t * | ctx, |
uint8_t | reg_address, | ||
uint8_t | write_data ) |
Generic write the byte of data function.
ctx | Click object. |
reg_address | Register address. |
write_data | Byte of data to write. |
@description Function write the 8-bit data to the target 8-bit register address of AK9750 sensor on IR Sense click board.