1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16-
1716#include "drivers/battery.h"
18-
1917#include "drivers/exti.h"
2018#include "drivers/gpio.h"
2119#include "board/board.h"
2220#include "drivers/otp.h"
2321#include "drivers/periph_config.h"
2422#include "system/logging.h"
25-
2623#include <mcu.h>
2724
2825#include <stdlib.h>
2926#include <string.h>
30-
3127#include "charger_eta4662.h"
3228
33-
34-
3529void battery_init (void ) {
3630 chager_init ();
3731}
3832
39-
4033int battery_get_millivolts (void ) {
4134 //ADCVoltageMonitorReading info = battery_read_voltage_monitor();
4235
@@ -52,3 +45,29 @@ int battery_get_millivolts(void) {
5245 return 3600 ;//battery_convert_reading_to_millivolts(info, 3599, 1373);
5346}
5447
48+ bool battery_charge_controller_thinks_we_are_charging_impl (void ) {
49+ return false;//pmic_is_charging();
50+ }
51+
52+ bool battery_is_usb_connected_impl (void ) {
53+ return false;//pmic_is_usb_connected();
54+ }
55+
56+ void battery_set_charge_enable (bool charging_enabled ) {
57+ //pmic_set_charger_state(charging_enabled);
58+ }
59+
60+ // TODO
61+ // This is my understanding from Figure 9 of the datasheet:
62+ // Charger off -> Pre charge -> Fast Charge (constant current) ->
63+ // Fast Charge (constant voltage) -> Maintain Charge -> Maintain Charge Done
64+ //
65+ // The Pre Charge and Charge Termination currents are programmed via I2C
66+ // The Fast Charge current is determined by Rset
67+ //
68+ // There doesn't seem to be a way to change the current in constant current mode
69+ void battery_set_fast_charge (bool fast_charge_enabled ) {
70+
71+ }
72+
73+
0 commit comments