PER Firmware
Loading...
Searching...
No Matches
cooling.h
Go to the documentation of this file.
1
11#ifndef _COOLING_H_
12#define _COOLING_H_
13
14#include "common/can_library/generated/PDU.h"
15
16#define GPS_SPEED_MOVING 2 // TODO determine
17#define MOTOR_COOLING_ENABLE_TEMP 60
18#define MOTOR_COOLING_MAX_TEMP 100
19#define BATT_COOLING_ENABLE_TEMP 30
20
21#define BATT_PUMP_ON_TEMP_C BATT_COOLING_ENABLE_TEMP
22#define BATT_PUMP_OFF_TEMP_C (BATT_COOLING_ENABLE_TEMP - 2)
23#define BATT_FAN_ON_TEMP_C BATT_COOLING_ENABLE_TEMP
24#define BATT_FAN_OFF_TEMP_C (BATT_COOLING_ENABLE_TEMP - 2)
25
26#define MOTOR_PUMP_ON_TEMP_C MOTOR_COOLING_ENABLE_TEMP
27#define MOTOR_PUMP_OFF_TEMP_C (MOTOR_COOLING_ENABLE_TEMP - 5)
28
29#define MOTOR_FAN_ON_TEMP_C MOTOR_COOLING_MAX_TEMP
30#define MOTOR_FAN_OFF_TEMP_C (MOTOR_COOLING_MAX_TEMP - 5)
31
32#define MOTOR_FAN_STOP_ON_TEMP_C MOTOR_COOLING_ENABLE_TEMP
33#define MOTOR_FAN_STOP_OFF_TEMP_C (MOTOR_COOLING_ENABLE_TEMP - 5)
34
35#define BANGBANG_MIN_SWITCH_MS 1000
36
37typedef struct {
38 uint16_t fan1_speed; // value from 0-100
39 uint16_t fan2_speed; // value from 0-100
40 uint16_t fan3_speed; // value from 0-100
41 uint16_t fan4_speed; // value from 0-100
42 bool pump1_status;
43 bool pump2_status;
44 bool fan1_status;
45 bool fan2_status;
46 bool fan3_status;
47 bool fan4_status;
48 bool hxfan_status;
50
58
66
73void cooling_driver_request_CALLBACK(can_data_t *p_can_data);
74#endif
void update_cooling_periodic()
Periodic function that sets switches and fan speeds based off of values in the cooling_request struct...
Definition cooling.c:77
void coolingInit()
Initializes cooling_request struct values to 0.
void cooling_driver_request_CALLBACK(can_data_t *p_can_data)
Callback function for cooling_driver_request message sent from dashboard, updates values in cooling_r...
Definition canpiler.c:79
Definition cooling.h:37