lightranger5 2.0.0.0
|
API for configuring and manipulating LightRanger 5 Click driver. More...
Topics | |
LightRanger 5 Registers List | |
List of registers of LightRanger 5 Click driver. | |
LightRanger 5 Registers Settings | |
Settings for registers of LightRanger 5 Click driver. | |
LightRanger 5 MikroBUS Map | |
MikroBUS pin mapping of LightRanger 5 Click driver. | |
Lightranger5_get | |
Functions | |
void | lightranger5_cfg_setup (lightranger5_cfg_t *cfg) |
LightRanger 5 configuration object setup function. | |
err_t | lightranger5_init (lightranger5_t *ctx, lightranger5_cfg_t *cfg) |
LightRanger 5 initialization function. | |
err_t | lightranger5_default_cfg (lightranger5_t *ctx) |
LightRanger 5 default configuration function. | |
err_t | lightranger5_generic_write (lightranger5_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
LightRanger 5 I2C writing function. | |
err_t | lightranger5_generic_read (lightranger5_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
LightRanger 5 I2C reading function. | |
err_t | lightranger5_enable_device (lightranger5_t *ctx) |
LightRanger 5 enable device function. | |
err_t | lightranger5_disable_device (lightranger5_t *ctx) |
LightRanger 5 disable device function. | |
err_t | lightranger5_set_pin_state_io0 (lightranger5_t *ctx, uint8_t io0_state) |
LightRanger 5 set IO0 pin state function. | |
err_t | lightranger5_set_pin_state_io1 (lightranger5_t *ctx, uint8_t io1_state) |
LightRanger 5 set IO1 pin state function. | |
err_t | lightranger5_device_reset (lightranger5_t *ctx) |
LightRanger 5 device reset function. | |
err_t | lightranger5_load_app (lightranger5_t *ctx) |
LightRanger 5 load app function. | |
err_t | lightranger5_start_calib_cmd (lightranger5_t *ctx) |
LightRanger 5 start calibration function. | |
err_t | lightranger5_check_factory_calibration (lightranger5_t *ctx) |
LightRanger 5 check factory calibration function. | |
err_t | lightranger5_get_status (lightranger5_t *ctx, uint8_t *status) |
LightRanger 5 get status function. | |
err_t | lightranger5_set_command (lightranger5_t *ctx, uint8_t cmd) |
LightRanger 5 set command function. | |
err_t | lightranger5_set_factory_calib_data (lightranger5_t *ctx, uint8_t *factory_calib_data) |
LightRanger 5 set factory calib data function. | |
err_t | lightranger5_get_factory_calib_data (lightranger5_t *ctx, uint8_t *factory_calib_data) |
LightRanger 5 get factory calib data function. | |
err_t | lightranger5_set_algorithm_state_data (lightranger5_t *ctx, uint8_t *alg_state_data) |
LightRanger 5 set algorithm state data function. | |
err_t | lightranger5_set_command_data (lightranger5_t *ctx, uint8_t *cmd_data) |
LightRanger 5 set command data function. | |
err_t | lightranger5_check_previous_command (lightranger5_t *ctx, uint8_t *previous_cmd) |
LightRanger 5 check previous command function. | |
err_t | lightranger5_get_currently_run_app (lightranger5_t *ctx, uint8_t *appid_data) |
LightRanger 5 get currently running application function. | |
lightranger5_return_data_ready_t | lightranger5_check_data_ready (lightranger5_t *ctx) |
LightRanger 5 check data ready function. | |
uint16_t | lightranger5_measure_distance (lightranger5_t *ctx) |
LightRanger 5 measure distance function. | |
uint8_t | lightranger5_check_int (lightranger5_t *ctx) |
LightRanger 5 check interrupt state function. | |
API for configuring and manipulating LightRanger 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void lightranger5_cfg_setup | ( | lightranger5_cfg_t * | cfg | ) |
LightRanger 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See lightranger5_cfg_t object definition for detailed explanation. |
lightranger5_return_data_ready_t lightranger5_check_data_ready | ( | lightranger5_t * | ctx | ) |
LightRanger 5 check data ready function.
This function check is new data ready of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
0x00
( LIGHTRANGER5_DATA_NOT_READY ) - Data not ready, 0x01
( LIGHTRANGER5_DATA_IS_READY ) - Data is ready.err_t lightranger5_check_factory_calibration | ( | lightranger5_t * | ctx | ) |
LightRanger 5 check factory calibration function.
This function check the factory calibration, check device ID and currently running application status of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t lightranger5_check_int | ( | lightranger5_t * | ctx | ) |
LightRanger 5 check interrupt state function.
This function check the interrupt state of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
0
- INT pin state low, 1
- INT pin state high.err_t lightranger5_check_previous_command | ( | lightranger5_t * | ctx, |
uint8_t * | previous_cmd ) |
LightRanger 5 check previous command function.
This function check the previous command that was executed or current if continues mode is selected of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
[out] | previous_cmd | :
|
0
- Success, -1
- Error.err_t lightranger5_default_cfg | ( | lightranger5_t * | ctx | ) |
LightRanger 5 default configuration function.
This function executes a default configuration of LightRanger 5 click board.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t lightranger5_device_reset | ( | lightranger5_t * | ctx | ) |
LightRanger 5 device reset function.
This function performs a software reset device and fully resetting CPU and all CPU registers of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t lightranger5_disable_device | ( | lightranger5_t * | ctx | ) |
LightRanger 5 disable device function.
This function disables the device by sets EN ( CS ) pin to low state of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t lightranger5_enable_device | ( | lightranger5_t * | ctx | ) |
LightRanger 5 enable device function.
This function enables the device by sets EN ( CS ) pin to high state of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t lightranger5_generic_read | ( | lightranger5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
LightRanger 5 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t lightranger5_generic_write | ( | lightranger5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
LightRanger 5 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t lightranger5_get_currently_run_app | ( | lightranger5_t * | ctx, |
uint8_t * | appid_data ) |
LightRanger 5 get currently running application function.
This function get currently running application mode of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
[out] | appid_data | :
|
0
- Success, -1
- Error.err_t lightranger5_get_factory_calib_data | ( | lightranger5_t * | ctx, |
uint8_t * | factory_calib_data ) |
LightRanger 5 get factory calib data function.
This function get the factory calibration data of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
[out] | factory_calib_data | : Pointer to the memory location where factory calibration data be stored. |
0
- Success, -1
- Error.err_t lightranger5_get_status | ( | lightranger5_t * | ctx, |
uint8_t * | status ) |
LightRanger 5 get status function.
This function get status data of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
[out] | status | : Status data. |
0
- Success, -1
- Error.err_t lightranger5_init | ( | lightranger5_t * | ctx, |
lightranger5_cfg_t * | cfg ) |
LightRanger 5 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See lightranger5_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t lightranger5_load_app | ( | lightranger5_t * | ctx | ) |
LightRanger 5 load app function.
This function set application that shall be started, set this to measurement app mode of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint16_t lightranger5_measure_distance | ( | lightranger5_t * | ctx | ) |
LightRanger 5 measure distance function.
This function measure the distance of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
See #err_t definition for detailed explanation.
err_t lightranger5_set_algorithm_state_data | ( | lightranger5_t * | ctx, |
uint8_t * | alg_state_data ) |
LightRanger 5 set algorithm state data function.
This function set algorithm state data array of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
[in] | alg_state_data | : Pointer to the memory location where factory algorithm state data be stored. |
0
- Success, -1
- Error.err_t lightranger5_set_command | ( | lightranger5_t * | ctx, |
uint8_t | cmd ) |
LightRanger 5 set command function.
This function set the command of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
[in] | cmd | : Command data. |
0
- Success, -1
- Error.err_t lightranger5_set_command_data | ( | lightranger5_t * | ctx, |
uint8_t * | cmd_data ) |
LightRanger 5 set command data function.
This function set command data array of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
[in] | cmd_data | : Pointer to the memory location where command data be stored. |
0
- Success, -1
- Error.err_t lightranger5_set_factory_calib_data | ( | lightranger5_t * | ctx, |
uint8_t * | factory_calib_data ) |
LightRanger 5 set factory calib data function.
This function set the factory calibration data of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
[in] | factory_calib_data | : Pointer to the memory location where factory calibration data be stored. |
0
- Success, -1
- Error.err_t lightranger5_set_pin_state_io0 | ( | lightranger5_t * | ctx, |
uint8_t | io0_state ) |
LightRanger 5 set IO0 pin state function.
This function sets the state of the IO0 ( RST ) pin of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
[in] | io0_state | :
|
0
- Success, -1
- Error.err_t lightranger5_set_pin_state_io1 | ( | lightranger5_t * | ctx, |
uint8_t | io1_state ) |
LightRanger 5 set IO1 pin state function.
This function sets the state of the IO1 ( PWM ) pin of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
[in] | io1_state | :
|
0
- Success, -1
- Error.err_t lightranger5_start_calib_cmd | ( | lightranger5_t * | ctx | ) |
LightRanger 5 start calibration function.
This function start the calibration of the TMF8801, Time-of-Flight Sensor on the LightRanger 5 click board™.
[in] | ctx | : Click context object. See lightranger5_t object definition for detailed explanation. |
0
- Success, -1
- Error.