qirx 2.0.0.0
Qi RX Click Driver

API for configuring and manipulating Qi RX Click driver. More...

Topics

 Qi RX Registers Settings
 Settings for registers of Qi RX Click driver.
 
 Qi RX MikroBUS Map
 MikroBUS pin mapping of Qi RX Click driver.
 

Functions

void qirx_cfg_setup (qirx_cfg_t *cfg)
 Qi RX configuration object setup function.
 
err_t qirx_init (qirx_t *ctx, qirx_cfg_t *cfg)
 Qi RX initialization function.
 
uint16_t qirx_read_data (qirx_t *ctx)
 Read data function.
 
uint16_t qirx_read_voltage (qirx_t *ctx, uint16_t v_ref)
 Read voltage function.
 

Detailed Description

API for configuring and manipulating Qi RX 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

◆ qirx_cfg_setup()

void qirx_cfg_setup ( qirx_cfg_t * cfg)

Qi RX configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ qirx_init()

err_t qirx_init ( qirx_t * ctx,
qirx_cfg_t * cfg )

Qi RX initialization function.

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

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

◆ qirx_read_data()

uint16_t qirx_read_data ( qirx_t * ctx)

Read data function.

Function is used to read raw data from MCP3221.

Parameters
[in]ctx: Click context object. See qirx_t object definition for detailed explanation.
Returns
Result 16-bit value that represents ADC value from output register.

◆ qirx_read_voltage()

uint16_t qirx_read_voltage ( qirx_t * ctx,
uint16_t v_ref )

Read voltage function.

Function is used to calculate voltage of the connected battery.

Parameters
[in]ctx: Click context object. See qirx_t object definition for detailed explanation.
[in]v_ref: 16-bit value representing power supply voltage.
Returns
Result 12-bit value that represents voltage in millivolts.