Skip to content

Commit

Permalink
turn off when battery is low (#186)
Browse files Browse the repository at this point in the history
* turn off when battery is low

switch off at 3.5V. remove python bq and fusb drivers

* run ruff

* update comment
  • Loading branch information
ChrisDick committed Aug 4, 2024
1 parent 24e2422 commit 2a196c3
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 1,358 deletions.
4 changes: 2 additions & 2 deletions drivers/tildagon_power/bq25895/bq25895.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ static void write_scaled( bq_state_t* state, scaled_register_t scaledregister, f
* @details reset then setup 500mA Iin limit, boost disabled, charging enabled,
* ADC at 1Hz, disable unused features and disable watchdog to reduce interruptions
* charge current limit to be 0.85C for the 1800mAh and 0.77C for 2000mAh batteries
* termination and precharge current to 64mA. min Vbat 3.5V
* termination and precharge current to 64mA. min Vsys to 3.0V
* @param state pmic object
*/
void bq_init( bq_state_t* state )
{
write_bits( state, register_reset, 1 );
uint8_t write_buffer[5] = { 0x02, 0x60, 0x1A, 0x18, 0x00 };
uint8_t write_buffer[5] = { 0x02, 0x60, 0x10, 0x18, 0x00 };
mp_machine_i2c_buf_t buffer = { .len = 5, .buf = write_buffer };
tildagon_mux_i2c_transaction( state->mux_port, ADDRESS, 1, &buffer, WRITE );
write_buffer[0] = 0x07;
Expand Down
Loading

0 comments on commit 2a196c3

Please sign in to comment.