charger11 2.0.0.0
charger11.h File Reference

This file contains API for Charger 11 Click Driver. More...

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

Go to the source code of this file.

Data Structures

struct  charger11_s
 Charger 11 Click context object. More...
 
struct  charger11_cfg_t
 Charger 11 Click configuration object. More...
 

Macros

#define CHARGER11_SPI_VOLATILE_WIPER_0   0x00
 Charger 11 description register.
 
#define CHARGER11_SPI_VOLATILE_WIPER_1   0x01
 
#define CHARGER11_SPI_NON_VOLATILE_WIPER_0   0x02
 
#define CHARGER11_SPI_NON_VOLATILE_WIPER_1   0x03
 
#define CHARGER11_SPI_VOLATILE_TCON   0x04
 
#define CHARGER11_SPI_STATUS_REGISTER   0x05
 
#define CHARGER11_SPI_DATA_EEPROM_0   0x06
 
#define CHARGER11_SPI_DATA_EEPROM_1   0x07
 
#define CHARGER11_SPI_DATA_EEPROM_2   0x08
 
#define CHARGER11_SPI_DATA_EEPROM_3   0x09
 
#define CHARGER11_SPI_DATA_EEPROM_4   0x0A
 
#define CHARGER11_SPI_DATA_EEPROM_5   0x0B
 
#define CHARGER11_SPI_DATA_EEPROM_6   0x0C
 
#define CHARGER11_SPI_DATA_EEPROM_7   0x0D
 
#define CHARGER11_SPI_DATA_EEPROM_8   0x0E
 
#define CHARGER11_SPI_DATA_EEPROM_9   0x0F
 
#define CHARGER11_PIN_ENABE   0x01
 Charger 11 description setting.
 
#define CHARGER11_PIN_DISABLE   0x00
 
#define CHARGER11_SET_DEV_ADDR   0x4D
 Charger 11 device address setting.
 
#define CHARGER11_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define CHARGER11_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define CHARGER11_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef struct charger11_s charger11_t
 Charger 11 Click context object.
 

Enumerations

enum  charger11_return_value_t { CHARGER11_OK = 0 , CHARGER11_ERROR = -1 }
 Charger 11 Click return value data. More...
 

Functions

void charger11_cfg_setup (charger11_cfg_t *cfg)
 Charger 11 configuration object setup function.
 
err_t charger11_init (charger11_t *ctx, charger11_cfg_t *cfg)
 Charger 11 initialization function.
 
err_t charger11_i2c_write (charger11_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Charger 11 I2C writing function.
 
err_t charger11_i2c_read (charger11_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Charger 11 I2C reading function.
 
err_t charger11_spi_write (charger11_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Charger 11 SPI writing function.
 
err_t charger11_spi_read (charger11_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Charger 11 SPI reading function.
 
uint8_t charger11_get_int (charger11_t *ctx)
 Charger 11 getting INT pin state.
 
void charger11_lr_set (charger11_t *ctx, uint8_t pin_state)
 Charger 11 setting AN pin state.
 
void charger11_lg_set (charger11_t *ctx, uint8_t pin_state)
 Charger 11 Setting PWM pin state.
 
void charger11_spi_transfer (charger11_t *ctx, uint8_t *data_in, uint8_t *data_out, uint8_t len)
 Charger 11 transfering bytes via SPI.
 
void charger11_spi_set_register (charger11_t *ctx, uint8_t register_address, uint16_t register_value)
 Charger 11 setting register.
 
void charger11_spi_get_register (charger11_t *ctx, uint8_t register_address, uint16_t *register_value)
 Charger 11 getting register value.
 
void charger11_spi_increment_wiper (charger11_t *ctx)
 Charger 11 incrementing wiper position.
 
void charger11_spi_decrement_wiper (charger11_t *ctx)
 Charger 11 decrementing wiper position.
 
uint8_t charger11_spi_get_wiper_position (charger11_t *ctx)
 Charger 11 getting wiper position.
 
uint16_t charger11_i2c_get_raw_data (charger11_t *ctx)
 Charger 11 getting raw ADC data.
 
float charger11_i2c_get_volt (charger11_t *ctx, float reference_voltage)
 Charger 11 getting output voltage.
 

Detailed Description

This file contains API for Charger 11 Click Driver.

Typedef Documentation

◆ charger11_t

typedef struct charger11_s charger11_t

Charger 11 Click context object.

Context object definition of Charger 11 Click driver.

Enumeration Type Documentation

◆ charger11_return_value_t

Charger 11 Click return value data.

Predefined enum values for driver return values.

Enumerator
CHARGER11_OK 
CHARGER11_ERROR