lr9  2.1.0.0
Modules | Functions
LR 9 Click Driver

API for configuring and manipulating LR 9 Click driver. More...

Modules

 LR 9 Device Settings
 Settings for registers of LR 9 Click driver.
 
 LR 9 MikroBUS Map
 MikroBUS pin mapping of LR 9 Click driver.
 

Functions

void lr9_cfg_setup (lr9_cfg_t *cfg)
 LR 9 configuration object setup function. More...
 
err_t lr9_init (lr9_t *ctx, lr9_cfg_t *cfg)
 LR 9 initialization function. More...
 
void lr9_hw_reset (lr9_t *ctx)
 LR 9 HW reset function. More...
 
void lr9_set_boot_pin (lr9_t *ctx, uint8_t state)
 LR 9 set BOOT pin state function. More...
 
err_t lr9_generic_write (lr9_t *ctx, uint8_t *data_in, uint16_t len)
 LR 9 data writing function. More...
 
err_t lr9_generic_read (lr9_t *ctx, uint8_t *data_out, uint16_t len)
 LR 9 data reading function. More...
 
err_t lr9_write_command (lr9_t *ctx, uint8_t *command, uint8_t *param)
 LR 9 command writing function. More...
 
err_t lr9_inquire_command (lr9_t *ctx, uint8_t *command, lr9_en_set_t en_set)
 LR 9 inquire writing function. More...
 
err_t lr9_send_data_frame (lr9_t *ctx, uint8_t confirm, uint8_t nbtrials, uint8_t *data_frame)
 LR 9 send data frame function. More...
 

Detailed Description

API for configuring and manipulating LR 9 Click driver.

Function Documentation

◆ lr9_cfg_setup()

void lr9_cfg_setup ( lr9_cfg_t cfg)

LR 9 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ lr9_generic_read()

err_t lr9_generic_read ( lr9_t ctx,
uint8_t *  data_out,
uint16_t  len 
)

LR 9 data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See lr9_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.

◆ lr9_generic_write()

err_t lr9_generic_write ( lr9_t ctx,
uint8_t *  data_in,
uint16_t  len 
)

LR 9 data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See lr9_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.

◆ lr9_hw_reset()

void lr9_hw_reset ( lr9_t ctx)

LR 9 HW reset function.

This function performs a hardware reset of the device.

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

◆ lr9_init()

err_t lr9_init ( lr9_t ctx,
lr9_cfg_t cfg 
)

LR 9 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See lr9_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See lr9_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ lr9_inquire_command()

err_t lr9_inquire_command ( lr9_t ctx,
uint8_t *  command,
lr9_en_set_t  en_set 
)

LR 9 inquire writing function.

Using the UART serial interface, this function writes the desired query command with or without the included equals symbol.

Parameters
[in]ctx: Click context object. See lr9_t object definition for detailed explanation.
[in]command: Command buffer for sending.
[in]param: Parameter buffer for sending.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ lr9_send_data_frame()

err_t lr9_send_data_frame ( lr9_t ctx,
uint8_t  confirm,
uint8_t  nbtrials,
uint8_t *  data_frame 
)

LR 9 send data frame function.

This function sends the desired data frame by using the UART serial interface.

Parameters
[in]ctx: Click context object. See lr9_t object definition for detailed explanation.
[in]command: Command buffer for sending.
[in]param: Parameter buffer for sending.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ lr9_set_boot_pin()

void lr9_set_boot_pin ( lr9_t ctx,
uint8_t  state 
)

LR 9 set BOOT pin state function.

This function sets a desired logic state of the BT pin.

Parameters
[in]ctx: Click context object. See lr9_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
Nothing.
Note
None.

◆ lr9_write_command()

err_t lr9_write_command ( lr9_t ctx,
uint8_t *  command,
uint8_t *  param 
)

LR 9 command writing function.

This function writes a desired command and parameter by using UART serial interface.

Parameters
[in]ctx: Click context object. See lr9_t object definition for detailed explanation.
[in]command: Command buffer for sending.
[in]param: Parameter buffer for sending.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.