lightranger7 2.1.0.0
LightRanger 7 Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ lightranger7_cfg_setup()

void lightranger7_cfg_setup ( lightranger7_cfg_t * cfg)

LightRanger 7 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See lightranger7_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ lightranger7_disable_device()

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.

Parameters
[in]ctx: Click context object. See lightranger7_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ lightranger7_enable_device()

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.

Parameters
[in]ctx: Click context object. See lightranger7_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ lightranger7_generic_read()

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.

Parameters
[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.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.
Note
None.

◆ lightranger7_generic_write()

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.

Parameters
[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.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ lightranger7_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ lightranger7_reset_device()

void lightranger7_reset_device ( lightranger7_t * ctx)

LightRanger 7 reset device function.

This function resets the device by toggling the rst pin state.

Parameters
[in]ctx: Click context object. See lightranger7_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ lightranger7_start_measurement()

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.

Parameters
[in]ctx: Click context object. See lightranger7_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
The click board must be programmed with a AFBR_S50_CANApp_RA4M2 firmware which support this command.

◆ lightranger7_stop_measurement()

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.

Parameters
[in]ctx: Click context object. See lightranger7_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
The click board must be programmed with a AFBR_S50_CANApp_RA4M2 firmware which support this command.