nanopower3 2.1.0.0
nanopower3.h File Reference

This file contains API for Nano Power 3 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  nanopower3_t
 Nano Power 3 Click context object. More...
 
struct  nanopower3_cfg_t
 Nano Power 3 Click configuration object. More...
 

Macros

#define NANOPOWER3_CMD_VREG   0x11
 Nano Power 3 description setting.
 
#define NANOPOWER3_CMD_NVREG   0x21
 
#define NANOPOWER3_CMD_VREGxNVREG   0x51
 
#define NANOPOWER3_CMD_NVREGxVREG   0x61
 
#define NANOPOWER3_1V_OUT_VOLTAGE   0x00
 Nano Power 3 output voltage selection setting.
 
#define NANOPOWER3_1V2_OUT_VOLTAGE   0x01
 
#define NANOPOWER3_1V5_OUT_VOLTAGE   0x02
 
#define NANOPOWER3_1V8_OUT_VOLTAGE   0x03
 
#define NANOPOWER3_2V_OUT_VOLTAGE   0x04
 
#define NANOPOWER3_2V5_OUT_VOLTAGE   0x05
 
#define NANOPOWER3_3V_OUT_VOLTAGE   0x06
 
#define NANOPOWER3_3V3_OUT_VOLTAGE   0x07
 
#define NANOPOWER3_3V5_OUT_VOLTAGE   0x08
 
#define NANOPOWER3_4V_OUT_VOLTAGE   0x09
 
#define NANOPOWER3_4V5_OUT_VOLTAGE   0x0A
 
#define NANOPOWER3_1V_RESISTANCE   187000
 Nano Power 3 output voltage resistance setting.
 
#define NANOPOWER3_1V2_RESISTANCE   93100
 
#define NANOPOWER3_1V5_RESISTANCE   53600
 
#define NANOPOWER3_1V8_RESISTANCE   37400
 
#define NANOPOWER3_2V_RESISTANCE   29000
 
#define NANOPOWER3_2V5_RESISTANCE   20000
 
#define NANOPOWER3_3V_RESISTANCE   15000
 
#define NANOPOWER3_3V3_RESISTANCE   13100
 
#define NANOPOWER3_3V5_RESISTANCE   12200
 
#define NANOPOWER3_4V_RESISTANCE   10000
 
#define NANOPOWER3_4V5_RESISTANCE   9000
 
#define NANOPOWER3_R11_RESISTANCE   7200
 Nano Power 3 calculation setting.
 
#define NANOPOWER3_DIGIPOT_MAX_RESISTANCE   200000
 
#define NANOPOWER3_DIGIPOT_MAX_VAL   255
 
#define NANOPOWER3_MAX_RESISTANCE   207200
 
#define NANOPOWER3_ROUND_TO_NEAREST_INT   0.5
 
#define NANOPOWER3_PIN_STATE_HIGH   0x01
 Nano Power 3 pin state setting.
 
#define NANOPOWER3_PIN_STATE_LOW   0x00
 
#define NANOPOWER3_DEVICE_ADDRESS_GND   0x28
 Nano Power 3 device address setting.
 
#define NANOPOWER3_DEVICE_ADDRESS_VCC   0x29
 
#define NANOPOWER3_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  nanopower3_return_value_t { NANOPOWER3_OK = 0 , NANOPOWER3_ERROR = -1 }
 Nano Power 3 Click return value data. More...
 

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

This file contains API for Nano Power 3 Click Driver.

Enumeration Type Documentation

◆ nanopower3_return_value_t

Nano Power 3 Click return value data.

Predefined enum values for driver return values.

Enumerator
NANOPOWER3_OK 
NANOPOWER3_ERROR