Midnight Sun Firmware
Loading...
Searching...
No Matches
cell_sense.h
1#pragma once
2
3/************************************************************************************************
4 * @file cell_sense.h
5 *
6 * @brief Header file for AFE cell sense
7 *
8 * @date 2025-01-12
9 * @author Midnight Sun Team #24 - MSXVI
10 ************************************************************************************************/
11
12/* Standard library Headers */
13#include <stdbool.h>
14#include <stdint.h>
15#include <stdlib.h>
16
17/* Inter-component Headers */
18#include "gpio.h"
19
20/* Intra-component Headers */
21#include "rear_controller.h"
22
29#define CONV_DELAY_MS 10
30#define AUX_CONV_DELAY_MS 3
31// Maximum number of retry attempts to read cell/aux data once triggered
32#define RETRY_DELAY_MS 1
33#define CELL_SENSE_CONVERSIONS 0
34
35#define SOLAR_VOLTAGE_THRESHOLD 42000
36#define AFE_BALANCING_UPPER_THRESHOLD 41500
37#define AFE_BALANCING_LOWER_THRESHOLD 40000
38
46
53
StatusCode log_cell_sense()
Logs the newest cell sense readings.
Definition: cell_sense.c:360
StatusCode cell_sense_init(RearControllerStorage *storage)
Initializes the cell sense sub-system.
Definition: cell_sense.c:417
StatusCode
StatusCodes for various errors.
Definition: status.h:27
Definition: rear_controller.h:39