Go to the source code of this file.
◆ getBrakePressure()
Gets the current brake pressure.
- Parameters
-
- Returns
- The current brake pressure.
Definition at line 17 of file BrakePressure.c.
◆ initBrakePressure()
void initBrakePressure |
( |
BrakePressure * |
bp, |
|
|
int |
hz, |
|
|
int |
channel |
|
) |
| |
Initializes the BrakePressure sensor with the given frequency and channel.
- Parameters
-
bp | Pointer to the BrakePressure structure to initialize. |
hz | The frequency in Hertz at which the sensor operates. |
channel | The analog channel the sensor is connected to. |
Definition at line 11 of file BrakePressure.c.
11 {
15}
void initAnalogSensor(AnalogSensor *analogSensor, const char *name, int hz, int channel)
Initializes an analog sensor and configures the corresponding GPIO pin.
void updateBrakePressure(void *bp)
Updates the brake pressure data.
void(* update)(void *self)
◆ transferFunctionBrakePressure()
float transferFunctionBrakePressure |
( |
float |
rawVal | ) |
|
Converts raw brake pressure data to a meaningful pressure value.
- Parameters
-
rawVal | The raw data from the brake pressure sensor. |
- Returns
- The converted brake pressure value.
Definition at line 28 of file BrakePressure.c.
28 {
30 printf("BrakePressure::transfer_function rawVal is too low\n");
31 return -1;
32 }
34 printf("BrakePressure::transfer_function rawVal is too high\n");
35 return 2001;
36 }
37 else {
39 }
40}
static const float kLowOutputSaturation
static const float kHighOutputSaturation
static const float kVoltsPerPSIA
static const float kOffsetVoltage
◆ updateBrakePressure()
void updateBrakePressure |
( |
void * |
bp | ) |
|
Updates the brake pressure data.
- Parameters
-
Definition at line 21 of file BrakePressure.c.
21 {
23 float rawData = 0.0f;
24 printf("Implement BrakePressure Update\n");
26}
float transferFunctionBrakePressure(float rawVal)
Converts raw brake pressure data to a meaningful pressure value.
◆ kHighOutputSaturation
const float kHighOutputSaturation = 4.65 |
|
static |
◆ kLowOutputSaturation
const float kLowOutputSaturation = 0.35 |
|
static |
◆ kOffsetVoltage
const float kOffsetVoltage = 0.201 |
|
static |
◆ kVoltsPerPSIA
const float kVoltsPerPSIA = 0.002 |
|
static |