Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
devboard_batt.h File Reference
#include "cascoda-bm/cascoda_types.h"
#include "ca821x_api.h"
#include "ca821x_error.h"
Include dependency graph for devboard_batt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BATT_TYPE_RCR123A   1
 
#define BATT_TYPE_CR123A   0
 
#define BATT_USB_PRESENT_PIN   5
 
#define BATT_VOLTS_TEST_PIN   6
 
#define BATT_VOLTS_PIN   35
 
#define BATT_CHARGE_STAT_PIN   36
 

Enumerations

enum  dvbd_charging_state { NOT_CHARGING = 0 , CHARGING = 1 }
 
enum  dvbd_vbus_state { NOT_CONNECTED = 0 , CONNECTED = 1 }
 

Functions

uint16_t DVBD_BattGetVolts (void)
 read the battery voltage More...
 
uint8_t DVBD_BattGetPercent (uint16_t vBatt)
 get the battery percentage More...
 
uint8_t DVBD_BattGetChargeStat (void)
 get the battery charging status More...
 
uint8_t DVBD_BattGetUSBPresent (void)
 check if +5V (USB Vbus or external) is connected More...
 
ca_error DVBD_BattInitChargeStat (void)
 initialise CHARGE_STAT More...
 
ca_error DVBD_BattInitVolts (void)
 initialise VOLTS and VOLTS_TEST More...
 
ca_error DVBD_BattInitUSBPresent (void)
 initialise USB_PRESENT More...
 

Macro Definition Documentation

◆ BATT_CHARGE_STAT_PIN

#define BATT_CHARGE_STAT_PIN   36

◆ BATT_TYPE_CR123A

#define BATT_TYPE_CR123A   0

◆ BATT_TYPE_RCR123A

#define BATT_TYPE_RCR123A   1

◆ BATT_USB_PRESENT_PIN

#define BATT_USB_PRESENT_PIN   5

◆ BATT_VOLTS_PIN

#define BATT_VOLTS_PIN   35

◆ BATT_VOLTS_TEST_PIN

#define BATT_VOLTS_TEST_PIN   6

Enumeration Type Documentation

◆ dvbd_charging_state

Enumerator
NOT_CHARGING 
CHARGING 

◆ dvbd_vbus_state

Enumerator
NOT_CONNECTED 
CONNECTED 

Function Documentation

◆ DVBD_BattGetChargeStat()

uint8_t DVBD_BattGetChargeStat ( void  )

get the battery charging status

Returns
NOT_CHARGING (0) or CHARGING (1)

◆ DVBD_BattGetPercent()

uint8_t DVBD_BattGetPercent ( uint16_t  vBatt)

get the battery percentage

Returns
battery percentage (%)

◆ DVBD_BattGetUSBPresent()

uint8_t DVBD_BattGetUSBPresent ( void  )

check if +5V (USB Vbus or external) is connected

Returns
NOT_CONNECTED (0) or CONNECTED (1)

◆ DVBD_BattGetVolts()

uint16_t DVBD_BattGetVolts ( void  )

read the battery voltage

Returns
vbatt * 100 (10mV resolution)

◆ DVBD_BattInitChargeStat()

ca_error DVBD_BattInitChargeStat ( void  )

initialise CHARGE_STAT

Returns
status

◆ DVBD_BattInitUSBPresent()

ca_error DVBD_BattInitUSBPresent ( void  )

initialise USB_PRESENT

Returns
status

◆ DVBD_BattInitVolts()

ca_error DVBD_BattInitVolts ( void  )

initialise VOLTS and VOLTS_TEST

Returns
status