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, void *child)
Initializes an analog sensor and configures the corresponding GPIO pin.
void updateBrakePressure(void *bp)
Updates the brake pressure data.
int(* update)(struct Updateable *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 31 of file BrakePressure.c.
31 {
33
34 #ifdef DEBUGn
35 printf("BrakePressure::transfer_function rawVal is too low\r\n");
36 #endif
37
38 return -1;
39 }
41
42 #ifdef DEBUGn
43 printf("BrakePressure::transfer_function rawVal is too high\r\n");
44 #endif
45
46 return 2001;
47 }
48 else {
50 }
51}
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 {
24
25 #ifdef DEBUGn
26 printf("BrakePressure::update rawVal: %f\r\n", rawData);
27 #endif
29}
float getAnalogSensorData(AnalogSensor *sensor)
Retrieves analog sensor data for a specific channel.
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.45 |
|
static |
◆ kOffsetVoltage
const float kOffsetVoltage = 0.5 |
|
static |
◆ kVoltsPerPSIA
const float kVoltsPerPSIA = 0.002 |
|
static |