lightranger 2.0.0.0
|
Functions | |
void | lightranger_cfg_setup (lightranger_cfg_t *cfg) |
Config Object Initialization function. | |
LIGHTRANGER_RETVAL | lightranger_init (lightranger_t *ctx, lightranger_cfg_t *cfg) |
Initialization function. | |
void | lightranger_default_cfg (lightranger_t *ctx) |
Click Default Configuration function. | |
void | lightranger_interrupts_clear (lightranger_t *ctx) |
Clear Interrupts. | |
void | lightranger_poll_range (lightranger_t *ctx) |
Poll range. | |
uint8_t | lightranger_get_distance (lightranger_t *ctx) |
Get Distance. | |
float | lightranger_get_ambiant_light (lightranger_t *ctx, uint8_t als_gain_check) |
Get ambiant light. | |
void | lightranger_start_single_shot_range_mode (lightranger_t *ctx) |
Function Start Single Mode. | |
uint16_t | lightranger_read_data (lightranger_t *ctx, uint16_t reg_addr) |
Generic read data function. | |
void | lightranger_write_data (lightranger_t *ctx, uint16_t reg_addr, uint16_t write_command) |
Generic write data function. | |
uint8_t | lightranger_read_byte (lightranger_t *ctx, uint16_t reg_addr) |
Generic read byte function. | |
void | lightranger_write_byte (lightranger_t *ctx, uint16_t reg_addr, uint8_t write_command) |
Generic write byte function. | |
void lightranger_cfg_setup | ( | lightranger_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void lightranger_default_cfg | ( | lightranger_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for LightRanger Click.
float lightranger_get_ambiant_light | ( | lightranger_t * | ctx, |
uint8_t | als_gain_check ) |
Get ambiant light.
lightranger | Click object. |
als_gain_check | ALS Gain value. |
@description This function reads register and calculates the light level in lux.
uint8_t lightranger_get_distance | ( | lightranger_t * | ctx | ) |
Get Distance.
lightranger | Click object. |
@description This function reads range result from register.
LIGHTRANGER_RETVAL lightranger_init | ( | lightranger_t * | ctx, |
lightranger_cfg_t * | cfg ) |
Initialization function.
lightranger | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void lightranger_interrupts_clear | ( | lightranger_t * | ctx | ) |
Clear Interrupts.
lightranger | Click object. |
@description This function clears interrupts.
void lightranger_poll_range | ( | lightranger_t * | ctx | ) |
Poll range.
lightranger | Click object. |
@description This function waits for new sample to be ready.
uint8_t lightranger_read_byte | ( | lightranger_t * | ctx, |
uint16_t | reg_addr ) |
Generic read byte function.
lightranger | Click object. |
reg_addr | 16-bit register address. |
@description This function reads a byte of data from given address.
uint16_t lightranger_read_data | ( | lightranger_t * | ctx, |
uint16_t | reg_addr ) |
Generic read data function.
lightranger | Click object. |
reg_addr | 16-bit register address. |
@description This function reads 16-bit data from given address.
void lightranger_start_single_shot_range_mode | ( | lightranger_t * | ctx | ) |
Function Start Single Mode.
lightranger | Click object. |
@description This function starts single shot range mode.
void lightranger_write_byte | ( | lightranger_t * | ctx, |
uint16_t | reg_addr, | ||
uint8_t | write_command ) |
Generic write byte function.
lightranger | Click object. |
reg_addr | 16-bit register address. |
write_command | Byte of data to write. |
@description This function writes a byte of data to given address.
void lightranger_write_data | ( | lightranger_t * | ctx, |
uint16_t | reg_addr, | ||
uint16_t | write_command ) |
Generic write data function.
lightranger | Click object. |
reg_addr | 16-bit register address. |
write_command | 16-bit command to write. |
@description This function writes 16-bit command to given address.