Midnight Sun Firmware
Loading...
Searching...
No Matches
pedal.h
1
#pragma once
2
3
/************************************************************************************************
4
* @file pedal.h
5
*
6
* @brief Header file for pedal in centre_console
7
*
8
* @date 2025-02-02
9
* @author Midnight Sun Team #24 - MSXVI
10
************************************************************************************************/
11
12
/* Standard library Headers */
13
#include <stdbool.h>
14
#include <stdint.h>
15
#include <stdio.h>
16
#include <stdlib.h>
17
#include <string.h>
18
19
/* Inter-component Headers */
20
#include "cc_hw_defs.h"
21
#include "interrupts.h"
22
#include "log.h"
23
#include "status.h"
24
25
/* Intra-component Headers */
26
33
typedef
struct
PedalCalibrationData
{
34
// When the pedal is considered fully unpressed
35
int16_t lower_value;
36
// When the pedal is considered fully pressed
37
int16_t upper_value;
38
}
PedalCalibrationData
;
39
40
typedef
struct
PedalCalibBlob
{
41
PedalCalibrationData
throttle_calib;
42
PedalCalibrationData
brake_calib;
43
}
PedalCalibBlob
;
44
45
// Runs a pedal cycle to update throttle and brake values
46
void
pedal_run();
47
48
// Initializes pedal peripherals
49
StatusCode
pedal_init(
PedalCalibBlob
*calib_blob);
50
StatusCode
StatusCode
StatusCodes for various errors.
Definition:
status.h:27
PedalCalibBlob
Definition:
pedal.h:40
PedalCalibrationData
Definition:
pedal.h:33
projects
centre_console
inc
pedal.h
Generated by
1.9.5