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 "../../Sensors/AnalogSensors/BrakePressure.h"
6#include "../../Sensors/AnalogSensors/Temperature.h"
7
8typedef enum{
16
17typedef struct{
31
32//Will probably update the pressure vars so it works with psi and not voltage so it's easier to understand
33//^As well as the temp sensor
46void initBrakeSystemControl(BrakeSystemControl *bsc, int hz, int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, int fbp_channel, int rbp_channel, int temp_channel);
47
56void setSensorReadings(BrakeSystemControl *bsc, float frontPressure, float rearPressure, float temperaure);
57
64
71
78
84int brakeSafteyCheck(void* bsc);
85
86// The following functions below are for testing functionality and should not be used elsewhere
87void setFrontPressure(BrakeSystemControl *bsc, float pressure);
88void setRearPressure(BrakeSystemControl *bsc, float pressure);
89void setTemperature(BrakeSystemControl *bsc, float temperature);
90
91#endif
void initBrakeSystemControl(BrakeSystemControl *bsc, int hz, int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, int fbp_channel, int rbp_channel, int temp_channel)
Initializes the Braking System with initial settings.
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 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, float frontPressure, float rearPressure, float temperaure)
Updates BrakeSystemStatus with current sensor data.
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
BrakeSystemStatus status
ControllerSystem base