Blame view

build6/epsilon-master/ion/src/device/battery.h 753 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  #ifndef ION_DEVICE_BATTERY_H
  #define ION_DEVICE_BATTERY_H
  
  #include "regs/regs.h"
  
  namespace Ion {
  namespace Battery {
  namespace Device {
  
  /*  Pin | Role              | Mode                  | Function
   * -----+-------------------+-----------------------+----------
   *  PA0 | BAT_CHRG          | Input, pulled up      | Low = charging, high = full
   *  PA1 | VBAT_SNS          | Analog                | ADC1_1
   */
  
  void init();
  void shutdown();
  void initGPIO();
  void initADC();
  
  constexpr GPIO ChargingGPIO = GPIOA;
  constexpr uint8_t ChargingPin = 0;
  
  constexpr GPIO ADCGPIO = GPIOA;
  constexpr uint8_t ADCPin = 1;
  constexpr uint8_t ADCChannel = 1;
  
  constexpr float ADCReferenceVoltage = 2.8f;
  constexpr float ADCDividerBridgeRatio = 2.0f;
  
  }
  }
  }
  
  #endif