lightranger7 2.1.0.0
|
API for configuring and manipulating LightRanger 7 Click driver. More...
Topics | |
LightRanger 7 Device Settings | |
Settings for registers of LightRanger 7 Click driver. | |
LightRanger 7 MikroBUS Map | |
MikroBUS pin mapping of LightRanger 7 Click driver. | |
Functions | |
void | lightranger7_cfg_setup (lightranger7_cfg_t *cfg) |
LightRanger 7 configuration object setup function. | |
err_t | lightranger7_init (lightranger7_t *ctx, lightranger7_cfg_t *cfg) |
LightRanger 7 initialization function. | |
err_t | lightranger7_generic_write (lightranger7_t *ctx, uint8_t *data_in, uint16_t len) |
LightRanger 7 data writing function. | |
err_t | lightranger7_generic_read (lightranger7_t *ctx, uint8_t *data_out, uint16_t len) |
LightRanger 7 data reading function. | |
err_t | lightranger7_start_measurement (lightranger7_t *ctx) |
LightRanger 7 start measurement function. | |
err_t | lightranger7_stop_measurement (lightranger7_t *ctx) |
LightRanger 7 stop measurement function. | |
void | lightranger7_enable_device (lightranger7_t *ctx) |
LightRanger 7 enable device function. | |
void | lightranger7_disable_device (lightranger7_t *ctx) |
LightRanger 7 disable device function. | |
void | lightranger7_reset_device (lightranger7_t *ctx) |
LightRanger 7 reset device function. | |
API for configuring and manipulating LightRanger 7 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void lightranger7_cfg_setup | ( | lightranger7_cfg_t * | cfg | ) |
LightRanger 7 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See lightranger7_cfg_t object definition for detailed explanation. |
void lightranger7_disable_device | ( | lightranger7_t * | ctx | ) |
LightRanger 7 disable device function.
This function disables the device by setting the rst pin to low logic state.
[in] | ctx | : Click context object. See lightranger7_t object definition for detailed explanation. |
void lightranger7_enable_device | ( | lightranger7_t * | ctx | ) |
LightRanger 7 enable device function.
This function enables the device by setting the rst pin to high logic state.
[in] | ctx | : Click context object. See lightranger7_t object definition for detailed explanation. |
err_t lightranger7_generic_read | ( | lightranger7_t * | ctx, |
uint8_t * | data_out, | ||
uint16_t | len ) |
LightRanger 7 data reading function.
This function reads a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See lightranger7_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer. See #err_t definition for detailed explanation. err_t lightranger7_generic_write | ( | lightranger7_t * | ctx, |
uint8_t * | data_in, | ||
uint16_t | len ) |
LightRanger 7 data writing function.
This function writes a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See lightranger7_t object definition for detailed explanation. |
[in] | data_in | : Data buffer for sending. |
[in] | len | : Number of bytes for sending. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t lightranger7_init | ( | lightranger7_t * | ctx, |
lightranger7_cfg_t * | cfg ) |
LightRanger 7 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See lightranger7_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See lightranger7_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void lightranger7_reset_device | ( | lightranger7_t * | ctx | ) |
LightRanger 7 reset device function.
This function resets the device by toggling the rst pin state.
[in] | ctx | : Click context object. See lightranger7_t object definition for detailed explanation. |
err_t lightranger7_start_measurement | ( | lightranger7_t * | ctx | ) |
LightRanger 7 start measurement function.
This function starts the measurement by sending the 's' command over UART serial interface.
[in] | ctx | : Click context object. See lightranger7_t object definition for detailed explanation. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t lightranger7_stop_measurement | ( | lightranger7_t * | ctx | ) |
LightRanger 7 stop measurement function.
This function stops the measurement by sending the 'p' command over UART serial interface.
[in] | ctx | : Click context object. See lightranger7_t object definition for detailed explanation. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation.