Go to the source code of this file.
◆ getAppPosition()
| float getAppPosition |
( |
App * |
app | ) |
|
Gets the current position of the APP.
- Parameters
-
| app | Pointer to the App structure to query. |
- Returns
- The current position of the APP.
Definition at line 17 of file App.c.
◆ initApp()
| void initApp |
( |
App * |
app, |
|
|
int |
hz, |
|
|
int |
channel, |
|
|
char * |
name |
|
) |
| |
Initializes the APP with the given frequency and channel.
- Parameters
-
| app | Pointer to the App structure to initialize. |
| hz | The frequency in Hertz at which the APP operates. |
| channel | The analog channel the APP is connected to. |
| name | The name of the sensor (default is "App"). |
Definition at line 6 of file App.c.
6 {
10
11
14
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 updateApp(App *app)
Updates the APP 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_position
int(* update)(struct Updateable *self)
◆ setAppPos()
| void setAppPos |
( |
App * |
app, |
|
|
float |
pos |
|
) |
| |
Sets pedal position in app sensor.
- Note
- For testing only
- Parameters
-
| app | Pointer to app sensor. |
| pos | Position to set on sensor. |
◆ transferFunctionApp()
| float transferFunctionApp |
( |
float |
rawVal | ) |
|
Converts raw APP data to a meaningful position value.
- Parameters
-
| rawVal | The raw data from the APP. |
- Returns
- The converted APP position value.
Definition at line 41 of file App.c.
41 {
42
43 if (rawVal < 0.5) {
44 return -1;
45 }
46 else if (rawVal > 4.5) {
47 return -2;
48 }
49 return (rawVal - 0.5)/4.0;
50}
◆ updateApp()
| void updateApp |
( |
App * |
app | ) |
|
Updates the APP data.
- Parameters
-
| app | Pointer to the App structure to update. |
Definition at line 21 of file App.c.
21 {
22
24
27
28
31 "APP reading below sensor minimum (%.3f V)", rawData);
34 "APP reading above sensor maximum (%.3f V)", rawData);
35 }
36
38
39}
float getAnalogSensorData(AnalogSensor *sensor)
Retrieves analog sensor data for a specific channel.
float transferFunctionApp(float rawVal)
Converts raw APP data to a meaningful position value.
void sendTelemetryValue(TelemetrySignal *signal, float value)
char name[MAX_NAME_LENGTH]