Midnight Sun Firmware
Loading...
Searching...
No Matches
brake_pedal.h
1#pragma once
2
3/************************************************************************************************
4 * @file brake_pedal.h
5 *
6 * @brief Header file for brake pedal manager
7 *
8 * @date 2025-09-15
9 * @author Midnight Sun Team #24 - MSXVI
10 ************************************************************************************************/
11/* Standard library Headers */
12#include <stdint.h>
13
14/* Inter-component Headers */
15#include "status.h"
16
17/* Intra-component Headers */
18#include "front_controller.h"
19
26typedef struct {
27 uint16_t lower_value;
28 uint16_t upper_value;
30
31typedef struct BrakePedalStorage {
32 float prev_reading;
33
34 BrakePedalCalibrationData calibration_data;
36
44
51
StatusCode brake_pedal_run()
Reads the pedal percentage and applies deadzone and filtering before updating the brake state.
Definition: brake_pedal.c:27
StatusCode brake_pedal_init(FrontControllerStorage *storage)
Initializes the brake pedal hardware interface loads calibration data from memory.
Definition: brake_pedal.c:51
StatusCode
StatusCodes for various errors.
Definition: status.h:27
Definition: brake_pedal.h:26
uint16_t upper_value
Definition: brake_pedal.h:28
uint16_t lower_value
Definition: brake_pedal.h:27
Definition: brake_pedal.h:31
Front Controller storage.
Definition: front_controller.h:59