charger12 2.0.0.0
charger12.h File Reference

This file contains API for CHARGER 12 Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  charger12_t
 Click ctx object definition. More...
 
struct  charger12_cfg_t
 Click configuration structure definition. More...
 

Macros

#define CHARGER12_MAP_MIKROBUS(cfg, mikrobus)
 
#define CHARGER12_RETVAL   uint8_t
 
#define CHARGER12_OK   0x00
 
#define CHARGER12_INIT_ERROR   0xFF
 
#define CHARGER12_SPI_VOLATILE_WIPER_0   0x00
 
#define CHARGER12_SPI_VOLATILE_WIPER_1   0x01
 
#define CHARGER12_SPI_NON_VOLATILE_WIPER_0   0x02
 
#define CHARGER12_SPI_NON_VOLATILE_WIPER_1   0x03
 
#define CHARGER12_SPI_VOLATILE_TCON   0x04
 
#define CHARGER12_SPI_STATUS_REGISTER   0x05
 
#define CHARGER12_SPI_DATA_EEPROM_0   0x06
 
#define CHARGER12_SPI_DATA_EEPROM_1   0x07
 
#define CHARGER12_SPI_DATA_EEPROM_2   0x08
 
#define CHARGER12_SPI_DATA_EEPROM_3   0x09
 
#define CHARGER12_SPI_DATA_EEPROM_4   0x0A
 
#define CHARGER12_SPI_DATA_EEPROM_5   0x0B
 
#define CHARGER12_SPI_DATA_EEPROM_6   0x0C
 
#define CHARGER12_SPI_DATA_EEPROM_7   0x0D
 
#define CHARGER12_SPI_DATA_EEPROM_8   0x0E
 
#define CHARGER12_SPI_DATA_EEPROM_9   0x0F
 
#define CHARGER12_MODE_Li   0
 
#define CHARGER12_MODE_NiMh_NiCd   1
 
#define CHARGER12_MODE_DISABLE   2
 
#define CHARGER12_MODE_NO_BATTERY   3
 

Functions

void charger12_cfg_setup (charger12_cfg_t *cfg)
 Config Object Initialization function.
 
CHARGER12_RETVAL charger12_init (charger12_t *ctx, charger12_cfg_t *cfg)
 Initialization function.
 
void charger12_generic_transfer (charger12_t *ctx, uint8_t *data_in, uint8_t *data_out, uint8_t tx_len, uint8_t rx_len)
 Generic transfer function.
 
uint8_t charger12_int_get (charger12_t *ctx)
 Getting INT pin state.
 
void charger12_pwm_set (charger12_t *ctx, uint8_t pin_state)
 Setting PWM pin state.
 
void charger12_rst_set (charger12_t *ctx, uint8_t pin_state)
 Setting RST pin state.
 
void charger12_cs_set (charger12_t *ctx, uint8_t pin_state)
 Setting CS pin state.
 
uint8_t charger12_mode_select (charger12_t *ctx, uint8_t mode_select)
 Selecting device operation mode.
 
void charger12_spi_set_register (charger12_t *ctx, uint8_t register_address, uint16_t register_value)
 Setting register.
 
void charger12_spi_increment_wiper (charger12_t *ctx)
 Incrementing wiper position.
 
void charger12_spi_decrement_wiper (charger12_t *ctx)
 Decrementing wiper position.
 

Detailed Description

This file contains API for CHARGER 12 Click driver.