Go to the source code of this file.
◆ getBrakePressure()
Gets the current brake pressure.
- Parameters
-
- Returns
- The current brake pressure.
Definition at line 23 of file BrakePressure.c.
◆ initBrakePressure()
| void initBrakePressure |
( |
BrakePressure * |
bp, |
|
|
int |
hz, |
|
|
int |
channel, |
|
|
char * |
name |
|
) |
| |
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. |
| name | The name of the sensor (default is "BrakePressure"). |
Definition at line 13 of file BrakePressure.c.
13 {
17
18
21}
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.
TelemetrySignal * registerTelemetrySignal(const char *name, TelemetryType type, UnitId unit_id, uint32_t expected_rate_ms, float custom_min, float custom_max)
TelemetrySignal * telem_raw
TelemetrySignal * telem_psi
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 46 of file BrakePressure.c.
46 {
48 return -1;
49 }
51 return 2001;
52 }
53 else {
55 }
56}
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 27 of file BrakePressure.c.
27 {
30
31
33
37 "Brake pressure reading below sensor minimum (%.3f V)", rawData);
38 }
else if (brakePressure->
pressure == 2001) {
40 "Brake pressure reading above sensor maximum (%.3f V)", rawData);
41 }
42
44}
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.
void sendTelemetryValue(TelemetrySignal *signal, float value)
char name[MAX_NAME_LENGTH]
◆ 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 |