Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
BrakeSystemControl.h
Go to the documentation of this file.
1#ifndef RENSSELAERMOTORSPORT_BRAKE_SYSTEM_CONTROL_H
2#define RENSSELAERMOTORSPORT_BRAKE_SYSTEM_CONTROL_H
3
4#include "../ControllerSystem.h"
5#include "../../../Inc/Outputs/DigitalOutput.h"
6#include "../../Sensors/AnalogSensors/BrakePressure.h"
7#include "../../Sensors/AnalogSensors/Temperature.h"
8
9typedef enum {
17
18typedef struct{
34
35//Will probably update the pressure vars so it works with psi and not voltage so it's easier to understand
36//^As well as the temp sensor
50void initBrakeSystemControl(BrakeSystemControl *bsc, int hz, int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, int fbp_channel, int rbp_channel, int temp_channel, int light_port);
51
52
59
66
73
80
87
94
100int brakeSafteyCheck(void* bsc);
101
102// The following functions below are for testing functionality and should not be used elsewhere
103void setFrontPressure(BrakeSystemControl *bsc, float pressure);
104void setRearPressure(BrakeSystemControl *bsc, float pressure);
105void setTemperature(BrakeSystemControl *bsc, float temperature);
106
107#endif
void activateBrakeLight(BrakeSystemControl *bsc)
Checks whether the line pressure is higher than the activation point specified by the user.
void setFrontPressure(BrakeSystemControl *bsc, float pressure)
void initBrakeSystemControl(BrakeSystemControl *bsc, int hz, int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, int fbp_channel, int rbp_channel, int temp_channel, int light_port)
Initializes the Braking System with initial settings.
void setTemperature(BrakeSystemControl *bsc, float temperature)
void setRearPressure(BrakeSystemControl *bsc, float pressure)
int brakeSafteyCheck(void *bsc)
Checks the saftey of the braking system.
void inHeavyBreaking(BrakeSystemControl *bsc)
Checks whether the line pressure is higher than the activation point specified by the user.
void setSensorReadings(BrakeSystemControl *bsc)
Updates BrakeSystemStatus with current sensor data.
int updateBrakeSystemControl(ControllerSystem *controller)
Updates the Brake System Controller.
int startBrakeSystemControl(BrakeSystemControl *bsc)
Starts the Brake System Controller.
BrakeSystemStatus
@ PRESSURE_SENSOR_ERROR
@ TEMPERATURE_OVER_LIMIT
@ PRESSURE_UNDER_LIMIT
@ TEMPERATURE_SENSOR_ERROR
@ BRAKES_OK
@ PRESSURE_OVER_LIMIT
BrakeSystemStatus checkSensorLimits(BrakeSystemControl *bsc)
Checks if the brake system is within the defined limits and desired ranges.
BrakePressure * rearPressure
Temperature * temperature
BrakePressure * frontPressure
DigitalOutput * brakeLight
BrakeSystemStatus status
ControllerSystem base