nanopower3 2.1.0.0
Nano Power 3 Click Driver

API for configuring and manipulating Nano Power 3 Click driver. More...

Topics

 Nano Power 3 Registers Settings
 Settings for registers of Nano Power 3 Click driver.
 
 Nano Power 3 MikroBUS Map
 MikroBUS pin mapping of Nano Power 3 Click driver.
 

Functions

void nanopower3_cfg_setup (nanopower3_cfg_t *cfg)
 Nano Power 3 configuration object setup function.
 
err_t nanopower3_init (nanopower3_t *ctx, nanopower3_cfg_t *cfg)
 Nano Power 3 initialization function.
 
err_t nanopower3_default_cfg (nanopower3_t *ctx)
 Nano Power 3 default configuration function.
 
err_t nanopower3_generic_write (nanopower3_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Nano Power 3 I2C writing function.
 
err_t nanopower3_generic_read (nanopower3_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Nano Power 3 I2C reading function.
 
uint8_t nanopower3_get_pg_pin_state (nanopower3_t *ctx)
 Nano Power 3 get PG pin state function.
 
uint8_t nanopower3_get_an_pin_state (nanopower3_t *ctx)
 Nano Power 3 get AN pin state function.
 
void nanopower3_set_ctr_pin (nanopower3_t *ctx, uint8_t pin_state)
 Nano Power 3 set CTRL pin state function.
 
err_t nanopower3_write_data (nanopower3_t *ctx, uint8_t cmd, uint8_t data_in)
 Nano Power 3 command writing function.
 
err_t nanopower3_set_wiper_pos (nanopower3_t *ctx, uint8_t wiper_pos)
 Nano Power 3 set wiper position function.
 
err_t nanopower3_set_resistance (nanopower3_t *ctx, uint32_t resistance)
 Nano Power 3 set resistance function.
 
err_t nanopower3_set_voltage (nanopower3_t *ctx, uint8_t out_vol)
 Nano Power 3 set output voltage function.
 

Detailed Description

API for configuring and manipulating Nano Power 3 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

◆ nanopower3_cfg_setup()

void nanopower3_cfg_setup ( nanopower3_cfg_t * cfg)

Nano Power 3 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ nanopower3_default_cfg()

err_t nanopower3_default_cfg ( nanopower3_t * ctx)

Nano Power 3 default configuration function.

This function executes a default configuration of Nano Power 3 click board.

Parameters
[in]ctx: Click context object. See nanopower3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ nanopower3_generic_read()

err_t nanopower3_generic_read ( nanopower3_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Nano Power 3 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See nanopower3_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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nanopower3_generic_write()

err_t nanopower3_generic_write ( nanopower3_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Nano Power 3 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See nanopower3_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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nanopower3_get_an_pin_state()

uint8_t nanopower3_get_an_pin_state ( nanopower3_t * ctx)

Nano Power 3 get AN pin state function.

This function is used to get state of the AN pin.

Parameters
[in]ctx: Click context object. See nanopower3_t object definition for detailed explanation.
Returns
  • 0 - Pin state low,
  • 1 - Pin state high.
Note
None.

◆ nanopower3_get_pg_pin_state()

uint8_t nanopower3_get_pg_pin_state ( nanopower3_t * ctx)

Nano Power 3 get PG pin state function.

This function is used to get state of the PG pin.

Parameters
[in]ctx: Click context object. See nanopower3_t object definition for detailed explanation.
Returns
  • 0 - Pin state low,
  • 1 - Pin state high.
Note
None.

◆ nanopower3_init()

err_t nanopower3_init ( nanopower3_t * ctx,
nanopower3_cfg_t * cfg )

Nano Power 3 initialization function.

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

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

◆ nanopower3_set_ctr_pin()

void nanopower3_set_ctr_pin ( nanopower3_t * ctx,
uint8_t pin_state )

Nano Power 3 set CTRL pin state function.

This function is used to set state of the CTRL pin.

Parameters
[in]ctx: Click context object. See nanopower3_t object definition for detailed explanation.
[in]pin_state: Output pin state.
Returns
Nothing.
Note
None.

◆ nanopower3_set_resistance()

err_t nanopower3_set_resistance ( nanopower3_t * ctx,
uint32_t resistance )

Nano Power 3 set resistance function.

This function is used to set resistance in Ohms of the Nano Power 3 Click.

Parameters
[in]ctx: Click context object. See nanopower3_t object definition for detailed explanation.
[in]resistance: Resistance to be set in Ohms.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nanopower3_set_voltage()

err_t nanopower3_set_voltage ( nanopower3_t * ctx,
uint8_t out_vol )

Nano Power 3 set output voltage function.

This function is used to set output voltage of the Nano Power 3 Click.

Parameters
[in]ctx: Click context object. See nanopower3_t object definition for detailed explanation.
[in]out_vol: Output voltage.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nanopower3_set_wiper_pos()

err_t nanopower3_set_wiper_pos ( nanopower3_t * ctx,
uint8_t wiper_pos )

Nano Power 3 set wiper position function.

This function is used to set wiper position of the Nano Power 3 Click.

Parameters
[in]ctx: Click context object. See nanopower3_t object definition for detailed explanation.
[in]wiper_pos: Wiper position to be set.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nanopower3_write_data()

err_t nanopower3_write_data ( nanopower3_t * ctx,
uint8_t cmd,
uint8_t data_in )

Nano Power 3 command writing function.

This function writes a command byte and desired data by using I2C serial interface.

Parameters
[in]ctx: Click context object. See nanopower3_t object definition for detailed explanation.
[in]cmd: Command to be sent.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.