Vehicle Control Unit 0.01
This is the c library for controlling the car.
|
#include "../ControllerSystem.h"
#include "../../Sensors/AnalogSensors/BrakePressure.h"
#include "../../Sensors/AnalogSensors/Temperature.h"
Go to the source code of this file.
Classes | |
struct | BrakeSystemControl |
Enumerations | |
enum | BrakeSystemStatus { BRAKES_OK , PRESSURE_UNDER_LIMIT , PRESSURE_OVER_LIMIT , PRESSURE_SENSOR_ERROR , TEMPERATURE_OVER_LIMIT , TEMPERATURE_SENSOR_ERROR } |
Functions | |
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. More... | |
void | setSensorReadings (BrakeSystemControl *bsc, float frontPressure, float rearPressure, float temperaure) |
Updates BrakeSystemStatus with current sensor data. More... | |
void | activateBrakeLight (BrakeSystemControl *bsc) |
Checks whether the line pressure is higher than the activation point specified by the user. More... | |
void | inHeavyBreaking (BrakeSystemControl *bsc) |
Checks whether the line pressure is higher than the activation point specified by the user. More... | |
BrakeSystemStatus | checkSensorLimits (BrakeSystemControl *bsc) |
Checks if the brake system is within the defined limits and desired ranges. More... | |
int | brakeSafteyCheck (void *bsc) |
Checks the saftey of the braking system. More... | |
void | setFrontPressure (BrakeSystemControl *bsc, float pressure) |
void | setRearPressure (BrakeSystemControl *bsc, float pressure) |
void | setTemperature (BrakeSystemControl *bsc, float temperature) |
enum BrakeSystemStatus |
Enumerator | |
---|---|
BRAKES_OK | |
PRESSURE_UNDER_LIMIT | |
PRESSURE_OVER_LIMIT | |
PRESSURE_SENSOR_ERROR | |
TEMPERATURE_OVER_LIMIT | |
TEMPERATURE_SENSOR_ERROR |
Definition at line 8 of file BrakeSystemControl.h.
void activateBrakeLight | ( | BrakeSystemControl * | bsc | ) |
Checks whether the line pressure is higher than the activation point specified by the user.
bsc | A pointer to the BrakeControl structure. |
Definition at line 28 of file BrakeSystemControl.c.
int brakeSafteyCheck | ( | void * | bsc | ) |
Checks the saftey of the braking system.
bsc | A pointer to the BrakeControl structure. |
Definition at line 65 of file BrakeSystemControl.c.
BrakeSystemStatus checkSensorLimits | ( | BrakeSystemControl * | bsc | ) |
Checks if the brake system is within the defined limits and desired ranges.
bsc | A pointer to the BrakeControl structure. |
Definition at line 46 of file BrakeSystemControl.c.
void inHeavyBreaking | ( | BrakeSystemControl * | bsc | ) |
Checks whether the line pressure is higher than the activation point specified by the user.
bsc | A pointer to the BrakeControl structure. |
Definition at line 37 of file BrakeSystemControl.c.
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.
bsc | A pointer to the BrakeControl structure. |
hz | Rate at which the sensorors are called (in hz). |
maxTemp | The maximum temperature limit set for the system (in farenheight). |
brakeLightActivationPoint | At what voltage the brake light will activate. |
heavyBrakingActivationPoint | At what voltage the system recognises "heavy braking". |
fbp_channel | The channel number for the front brake pressure sensor |
rbp_channel | The channel number for the rear brake pressure sensor |
temp_channel | The channel number for the temperature sensor |
Definition at line 6 of file BrakeSystemControl.c.
void setFrontPressure | ( | BrakeSystemControl * | bsc, |
float | pressure | ||
) |
Definition at line 80 of file BrakeSystemControl.c.
void setRearPressure | ( | BrakeSystemControl * | bsc, |
float | pressure | ||
) |
Definition at line 84 of file BrakeSystemControl.c.
void setSensorReadings | ( | BrakeSystemControl * | bsc, |
float | frontPressure, | ||
float | rearPressure, | ||
float | temperaure | ||
) |
Updates BrakeSystemStatus with current sensor data.
bsc | A pointer to the BrakeControl structure. |
frontPressure | The reading from the front brake line pressure sensor (in psi). |
rearPressure | The reading from the rear brake line pressure sensor (in psi). |
temperature | The reading from the brake rotor temperature sensor (in farenheight). |
Definition at line 22 of file BrakeSystemControl.c.
void setTemperature | ( | BrakeSystemControl * | bsc, |
float | temperature | ||
) |
Definition at line 88 of file BrakeSystemControl.c.