lightranger9 2.0.0.0
|
API for configuring and manipulating LightRanger 9 Click driver. More...
Topics | |
LightRanger 9 Registers List | |
List of registers of LightRanger 9 Click driver. | |
LightRanger 9 Registers Settings | |
Settings for registers of LightRanger 9 Click driver. | |
LightRanger 9 MikroBUS Map | |
MikroBUS pin mapping of LightRanger 9 Click driver. | |
Functions | |
void | lightranger9_cfg_setup (lightranger9_cfg_t *cfg) |
LightRanger 9 configuration object setup function. | |
err_t | lightranger9_init (lightranger9_t *ctx, lightranger9_cfg_t *cfg) |
LightRanger 9 initialization function. | |
err_t | lightranger9_default_cfg (lightranger9_t *ctx) |
LightRanger 9 default configuration function. | |
err_t | lightranger9_generic_write (lightranger9_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
LightRanger 9 I2C writing function. | |
err_t | lightranger9_generic_read (lightranger9_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
LightRanger 9 I2C reading function. | |
err_t | lightranger9_write_register (lightranger9_t *ctx, uint8_t reg, uint8_t data_in) |
LightRanger 9 write register function. | |
err_t | lightranger9_read_register (lightranger9_t *ctx, uint8_t reg, uint8_t *data_out) |
LightRanger 9 read register function. | |
err_t | lightranger9_write_bl_cmd (lightranger9_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len) |
LightRanger 9 write bl cmd function. | |
err_t | lightranger9_read_bl_cmd_status (lightranger9_t *ctx, uint8_t *status) |
LightRanger 9 read bl cmd status function. | |
err_t | lightranger9_check_communication (lightranger9_t *ctx) |
LightRanger 9 check communication function. | |
void | lightranger9_set_gpio0_pin (lightranger9_t *ctx, uint8_t state) |
LightRanger 9 set gpio0 pin function. | |
void | lightranger9_set_gpio1_pin (lightranger9_t *ctx, uint8_t state) |
LightRanger 9 set gpio1 pin function. | |
void | lightranger9_enable_device (lightranger9_t *ctx) |
LightRanger 9 enable device function. | |
void | lightranger9_disable_device (lightranger9_t *ctx) |
LightRanger 9 disable device function. | |
uint8_t | lightranger9_get_int_pin (lightranger9_t *ctx) |
LightRanger 9 get int pin function. | |
err_t | lightranger9_download_fw_bin (lightranger9_t *ctx) |
LightRanger 9 download fw bin function. | |
err_t | lightranger9_clear_interrupts (lightranger9_t *ctx) |
LightRanger 9 clear interrupts function. | |
err_t | lightranger9_get_capture (lightranger9_t *ctx, lightranger9_capture_t *capture) |
LightRanger 9 get capture function. | |
API for configuring and manipulating LightRanger 9 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void lightranger9_cfg_setup | ( | lightranger9_cfg_t * | cfg | ) |
LightRanger 9 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See lightranger9_cfg_t object definition for detailed explanation. |
err_t lightranger9_check_communication | ( | lightranger9_t * | ctx | ) |
LightRanger 9 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t lightranger9_clear_interrupts | ( | lightranger9_t * | ctx | ) |
LightRanger 9 clear interrupts function.
This function reads and clears the interrupt status register.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t lightranger9_default_cfg | ( | lightranger9_t * | ctx | ) |
LightRanger 9 default configuration function.
This function executes a default configuration of LightRanger 9 click board.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void lightranger9_disable_device | ( | lightranger9_t * | ctx | ) |
LightRanger 9 disable device function.
This function disables the device by setting the EN pin to low logic state.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
err_t lightranger9_download_fw_bin | ( | lightranger9_t * | ctx | ) |
LightRanger 9 download fw bin function.
This function checks if the bootloader is running and then writes the tof_bin_image FW image to the device.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void lightranger9_enable_device | ( | lightranger9_t * | ctx | ) |
LightRanger 9 enable device function.
This function enables the device by setting the EN pin to high logic state.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
err_t lightranger9_generic_read | ( | lightranger9_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
LightRanger 9 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 lightranger9_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t lightranger9_generic_write | ( | lightranger9_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
LightRanger 9 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 lightranger9_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t lightranger9_get_capture | ( | lightranger9_t * | ctx, |
lightranger9_capture_t * | capture ) |
LightRanger 9 get capture function.
This function reads and parses a single sub-capture block of 132 bytes.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
[out] | capture | : Capture data object. See lightranger9_capture_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t lightranger9_get_int_pin | ( | lightranger9_t * | ctx | ) |
LightRanger 9 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
err_t lightranger9_init | ( | lightranger9_t * | ctx, |
lightranger9_cfg_t * | cfg ) |
LightRanger 9 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See lightranger9_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t lightranger9_read_bl_cmd_status | ( | lightranger9_t * | ctx, |
uint8_t * | status ) |
LightRanger 9 read bl cmd status function.
This function reads a bootloader command status by using I2C serial interface.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
[out] | status | : Bootloader command status byte. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t lightranger9_read_register | ( | lightranger9_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
LightRanger 9 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void lightranger9_set_gpio0_pin | ( | lightranger9_t * | ctx, |
uint8_t | state ) |
LightRanger 9 set gpio0 pin function.
This function sets the GPIO 0 pin logic state.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void lightranger9_set_gpio1_pin | ( | lightranger9_t * | ctx, |
uint8_t | state ) |
LightRanger 9 set gpio1 pin function.
This function sets the GPIO 1 pin logic state.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t lightranger9_write_bl_cmd | ( | lightranger9_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
LightRanger 9 write bl cmd function.
This function writes a desired number of data bytes to the selected bootloader command by using I2C serial interface.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
[in] | cmd | : Command byte. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t lightranger9_write_register | ( | lightranger9_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
LightRanger 9 write register function.
This function writes a desired data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See lightranger9_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.