2017-05-30 22:58:20 +00:00
|
|
|
#ifndef __ADC_H__
|
|
|
|
#define __ADC_H__
|
|
|
|
|
|
|
|
#include "ch.h"
|
|
|
|
#include "hal.h"
|
|
|
|
|
2017-07-07 00:14:52 +00:00
|
|
|
#define isUsbConnected() (getUSBVoltageMV() > 300)
|
2017-07-01 02:12:22 +00:00
|
|
|
|
2017-05-30 22:58:20 +00:00
|
|
|
void initADC(void);
|
|
|
|
void deinitADC(void);
|
|
|
|
uint16_t getBatteryVoltageMV(void);
|
|
|
|
uint16_t getSolarVoltageMV(void);
|
|
|
|
uint16_t getUSBVoltageMV(void);
|
|
|
|
uint16_t getSTM32Temperature(void);
|
|
|
|
void boost_voltage(bool boost);
|
|
|
|
|
|
|
|
#endif
|
2017-07-07 00:14:52 +00:00
|
|
|
|