Midnight Sun Firmware
Loading...
Searching...
No Matches
fan.h
1#pragma once
2
3/************************************************************************************************
4 * @file fann.h
5 *
6 * @brief Header file for BMS fans
7 *
8 * @date 2025-02-06
9 * @author Midnight Sun Team #24 - MSXVI
10 ************************************************************************************************/
11
12/* Standard library Headers */
13
14/* Inter-component Headers */
15#include "gpio.h"
16#include "log.h"
17
18/* Intra-component Headers */
19#include "bms_carrier.h"
20#include "bms_carrier_getters.h"
21#include "bms_carrier_setters.h"
22
36};
37
39#define BMS_FAN_PERIOD_MS 40U
41#define BMS_FAN_TEMP_UPPER_THRESHOLD 50U
43#define BMS_FAN_TEMP_LOWER_THRESHOLD 40U
45#define BMS_FAN_BASE_DUTY_CYCLE 50U
46
54
58void update_fans(void);
59
65uint8_t calculate_fan_dc(uint16_t temperature);
66
StatusCode
StatusCodes for various errors.
Definition: status.h:27
void update_fans(void)
Update the BMS fans output.
Definition: fan.c:37
uint8_t calculate_fan_dc(uint16_t temperature)
Calculate the fan duty cycle.
Definition: fan.c:25
StatusCode fans_init(BmsStorage *storage)
Initialize the BMS fans.
Definition: fan.c:47
Battery management system storage.
Definition: bms_carrier.h:50
Fan settings.
Definition: fan.h:32
GpioAddress fan1_sense
Definition: fan.h:33
GpioAddress fan_pwm_ctrl
Definition: fan.h:35
GpioAddress fan2_sense
Definition: fan.h:34
Port and pin data.
Definition: gpio.h:112