lightranger4 2.0.0.0
|
Functions | |
void | lightranger4_cfg_setup (lightranger4_cfg_t *cfg) |
Config Object Initialization function. | |
LIGHTRANGER4_RETVAL | lightranger4_init (lightranger4_t *ctx, lightranger4_cfg_t *cfg) |
Initialization function. | |
LIGHTRANGER4_RETVAL | lightranger4_default_cfg (lightranger4_t *ctx) |
Click Default Configuration function. | |
void | lightranger4_generic_write (lightranger4_t *ctx, uint16_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | lightranger4_generic_read (lightranger4_t *ctx, uint16_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | lightranger4_software_reset (lightranger4_t *ctx) |
Function for software reset. | |
void | lightranger4_start_measurement (lightranger4_t *ctx, uint32_t period_ms) |
Functions for start measurement. | |
uint8_t | lightranger4_new_data_ready (lightranger4_t *ctx) |
Function that checks whether the new data is ready for reading. | |
uint16_t | lightranger4_get_distance (lightranger4_t *ctx) |
Function reads distance of the object in front of the sensor. | |
uint16_t | lightranger4_get_signal_rate (lightranger4_t *ctx) |
Function reads signal rate. | |
uint8_t | lightranger4_set_distance_mode (lightranger4_t *ctx, uint8_t mode) |
Functions for sets distance measurement mode. | |
uint8_t | lightranger4_get_range_status (lightranger4_t *ctx) |
Function reads range status. | |
void | lightranger4_set_center (lightranger4_t *ctx, uint8_t center_x, uint8_t center_y) |
Functions for set center position. | |
void | lightranger4_set_zone_size (lightranger4_t *ctx, uint8_t width, uint8_t height) |
Functions for sets zone size. | |
void | lightranger4_set_user_roi (lightranger4_t *ctx, lightranger4_user_roi_t *roi) |
Functions for sets user Roi. | |
LIGHTRANGER4_RETVAL | lightranger4_set_measurement_timing_budget (lightranger4_t *ctx, uint32_t budget_us) |
Functions for sets measurement timing budget. | |
uint8_t | lightranger4_get_intrrupt_state (lightranger4_t *ctx) |
Function reads interrupt pin state. | |
void | lightranger4_set_xshut_pin (lightranger4_t *ctx, uint8_t state) |
Function for sets XSHUT pin. | |
void | lightranger4_power_on (lightranger4_t *ctx) |
Function for starts power ON procedure. | |
void lightranger4_cfg_setup | ( | lightranger4_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
LIGHTRANGER4_RETVAL lightranger4_default_cfg | ( | lightranger4_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
Function | return device error status (_ID_IS_NOT_VALID or _FIRMWARE_TIMEOUT_ERROR) or device ok status (_INIT_IS_SUCCESSFUL) |
@description This function executes default configuration for LightRanger4 click.
void lightranger4_generic_read | ( | lightranger4_t * | ctx, |
uint16_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 lightranger4_generic_write | ( | lightranger4_t * | ctx, |
uint16_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.
uint16_t lightranger4_get_distance | ( | lightranger4_t * | ctx | ) |
Function reads distance of the object in front of the sensor.
ctx | Click object. |
Distance | in mm |
uint8_t lightranger4_get_intrrupt_state | ( | lightranger4_t * | ctx | ) |
Function reads interrupt pin state.
ctx | Click object. |
Interrupt | pin state |
uint8_t lightranger4_get_range_status | ( | lightranger4_t * | ctx | ) |
Function reads range status.
ctx | Click object. |
Range | status |
uint16_t lightranger4_get_signal_rate | ( | lightranger4_t * | ctx | ) |
Function reads signal rate.
ctx | Click object. |
signal | rate |
LIGHTRANGER4_RETVAL lightranger4_init | ( | lightranger4_t * | ctx, |
lightranger4_cfg_t * | cfg ) |
Initialization function.
lightranger4 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t lightranger4_new_data_ready | ( | lightranger4_t * | ctx | ) |
Function that checks whether the new data is ready for reading.
ctx | Click object. |
Funstion | return information about new data (0 - if new data is ready or 1 - if new data is not ready) |
void lightranger4_power_on | ( | lightranger4_t * | ctx | ) |
Function for starts power ON procedure.
ctx | Click object. |
void lightranger4_set_center | ( | lightranger4_t * | ctx, |
uint8_t | center_x, | ||
uint8_t | center_y ) |
Functions for set center position.
ctx | Click object. |
center_x | Center X position |
center_y | Center Y position |
uint8_t lightranger4_set_distance_mode | ( | lightranger4_t * | ctx, |
uint8_t | mode ) |
Functions for sets distance measurement mode.
ctx | Click object. |
mode | Distance measurement mode |
LIGHTRANGER4_RETVAL lightranger4_set_measurement_timing_budget | ( | lightranger4_t * | ctx, |
uint32_t | budget_us ) |
Functions for sets measurement timing budget.
ctx | Click object. |
budget_us | Measurement timing budget in us |
Function | return error status (_INSUFFICIENT_BUDGET or _TOO_HIGH_BUDGET) or device ok status (_BUDGET_IS_SUCCESSFULLY_SET) |
void lightranger4_set_user_roi | ( | lightranger4_t * | ctx, |
lightranger4_user_roi_t * | roi ) |
Functions for sets user Roi.
ctx | Click object. |
(struct)roi | User Roi |
void lightranger4_set_xshut_pin | ( | lightranger4_t * | ctx, |
uint8_t | state ) |
Function for sets XSHUT pin.
ctx | Click object. |
state | Pin state |
void lightranger4_set_zone_size | ( | lightranger4_t * | ctx, |
uint8_t | width, | ||
uint8_t | height ) |
Functions for sets zone size.
ctx | Click object. |
width | Width zone size min(4) and max(16) |
height | Height zone size min(4) and max(16) |
void lightranger4_software_reset | ( | lightranger4_t * | ctx | ) |
Function for software reset.
ctx | Click object. |
void lightranger4_start_measurement | ( | lightranger4_t * | ctx, |
uint32_t | period_ms ) |
Functions for start measurement.
ctx | Click object. |
perion_ms | Inter measurement period in ms |