demo-epb  v1.0
Elektrische Parkbremse - slohmaier Dev Process Demo
actuator_driver.h
gehe zur Dokumentation dieser Datei
1 /**
2  * @file actuator_driver.h
3  * @brief Low-level control of the EPB actuators.
4  *
5  * @arch SWA-003
6  * @reqs SWE-006 SWE-013 SWE-014 SWE-015
7  *
8  * ASIL: B
9  */
10 #ifndef ACTUATOR_DRIVER_H
11 #define ACTUATOR_DRIVER_H
12 
13 #include "epb_types.h"
14 
15 typedef enum {
18  ACT_DIR_RELEASE = 2
20 
21 typedef struct {
23  uint8_t pwm_percent; /* 0..100 */
24  uint16_t current_ma; /* current motor current */
25  uint16_t peak_current_ma;
26  uint16_t clamping_force_n; /* estimated from current */
30 
31 /** Current limit (spec) and time window for cutoff (spec). */
32 #define ACT_OVERCURRENT_LIMIT_MA 8000U
33 #define ACT_OVERCURRENT_WINDOW_MS 100U
34 #define ACT_FORCE_PER_AMP_N 2500U /* lineare Naeherung */
35 
37 EpbStatus actuator_apply(ActuatorId id, uint8_t pwm_percent);
38 EpbStatus actuator_release(ActuatorId id, uint8_t pwm_percent);
41 
42 /**
43  * @brief ISR hook for current sampling. Called at 1 kHz.
44  *
45  * Replaced by test doubles for testing.
46  */
47 void actuator_isr_1khz(ActuatorId id, uint16_t current_sample_ma);
48 
49 #endif /* ACTUATOR_DRIVER_H */
EpbStatus actuator_release(ActuatorId id, uint8_t pwm_percent)
EpbStatus actuator_init(void)
ActuatorStatus actuator_get_status(ActuatorId id)
EpbStatus actuator_apply(ActuatorId id, uint8_t pwm_percent)
void actuator_isr_1khz(ActuatorId id, uint16_t current_sample_ma)
ISR hook for current sampling.
ActuatorDirection
@ ACT_DIR_STOP
@ ACT_DIR_RELEASE
@ ACT_DIR_APPLY
EpbStatus actuator_stop(ActuatorId id)
Common types for the EPB software.
EpbStatus
Definition: epb_types.h:13
ActuatorId
Definition: epb_types.h:30
uint16_t clamping_force_n
uint16_t peak_current_ma
ActuatorDirection direction
uint16_t current_ma
EpbStatus last_error