We are hoping to find an example of how to use Battservice with ADC.
Our system is driven by a LiPo, which has a max voltage of 4.2V. We are using an external DC/DC to regulate the 4.3V down to 3V which powers a CC2650.
We have setup a voltage divider to cut the 4.2V down to 2.1 and apply it to a ADC capable pin of the CC2650. We would like to use Battservice.h with this external voltage to determine the charge status of our system battery.
Battservice.h defines:
/********************************************************************* * @fn Batt_Setup * * @brief Set up which ADC source is to be used. Defaults to VDD/3. * * @param adc_ch - ADC Channel, e.g. HAL_ADC_CHN_AIN6 * @param minVal - max battery level * @param maxVal - min battery level * @param sCB - HW setup callback * @param tCB - HW tear down callback * @param cCB - percentage calculation callback * * @return none. */ extern void Batt_Setup(uint16 maxVal, battServiceSetupCB_t sCB, battServiceTeardownCB_t tCB);
That sounds great, but if you look at the function signature, it does not match the comments. So we would like to know if there is a more full featured version of Battservice that allows for ADC from a pin.
As a more general question, is there a ADC example somewhere in the BLE Stack 2.1 source code? A search for ADC doesn't turn up much.
Thanks.