nanopower3 2.1.0.0
|
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. | |
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.
void nanopower3_cfg_setup | ( | nanopower3_cfg_t * | cfg | ) |
Nano Power 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See nanopower3_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See nanopower3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See nanopower3_t object definition for detailed explanation. |
0
- Pin state low, 1
- Pin state high. 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.
[in] | ctx | : Click context object. See nanopower3_t object definition for detailed explanation. |
0
- Pin state low, 1
- Pin state high. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See nanopower3_t object definition for detailed explanation. |
[in] | pin_state | : Output pin state. |
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.
[in] | ctx | : Click context object. See nanopower3_t object definition for detailed explanation. |
[in] | resistance | : Resistance to be set in Ohms. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See nanopower3_t object definition for detailed explanation. |
[in] | out_vol | : Output voltage. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See nanopower3_t object definition for detailed explanation. |
[in] | wiper_pos | : Wiper position to be set. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.