◆ icuovercapture()
| static void icuovercapture |
( |
ICUDriver * |
icup, |
|
|
size_t |
index |
|
) |
| |
|
static |
◆ icuovercapture_in1()
| static void icuovercapture_in1 |
( |
ICUDriver * |
icup | ) |
|
|
static |
Definition at line 74 of file sent_hw_icu.cpp.
75{
77}
static void icuovercapture(ICUDriver *icup, size_t index)
◆ icuperiodcb()
| static void icuperiodcb |
( |
ICUDriver * |
icup, |
|
|
size_t |
index |
|
) |
| |
|
static |
Definition at line 34 of file sent_hw_icu.cpp.
35{
36 uint16_t clocks;
37 uint8_t flags = 0;
38 const ICUConfig *
icucfg = icup->config;
39
40 if ((
icucfg->channel == ICU_CHANNEL_1) || (
icucfg->channel == ICU_CHANNEL_2)) {
41
42 clocks = icuGetPeriodX(icup);
43 } else {
44
45
46 uint16_t val = icuGetWidthX(icup);
47
48
50
52 }
53
55 flags |= SENT_FLAG_HW_OVERFLOW;
57 }
58
60}
void SENT_ISR_Handler(uint8_t channel, uint16_t clocks, uint8_t flags)
static ICUConfig icucfg[SENT_INPUT_COUNT]
static uint16_t lastPulse[SENT_INPUT_COUNT]
Referenced by icuperiodcb_in1().
◆ icuperiodcb_in1()
| static void icuperiodcb_in1 |
( |
ICUDriver * |
icup | ) |
|
|
static |
Definition at line 69 of file sent_hw_icu.cpp.
70{
72}
static void icuperiodcb(ICUDriver *icup, size_t index)
◆ startSent()
Definition at line 95 of file sent_hw_icu.cpp.
95 {
96 for (int i = 0; i < SENT_INPUT_COUNT; i++) {
98
100 continue;
101 }
102
103 ICUConfig *cfg = &
icucfg[i];
104 ICUDriver *icu;
106 uint32_t baseClock;
107
108 if (
getIcuParams(sentPin, &pinAF, &icu, &cfg->channel, &baseClock) !=
true) {
109
110 criticalError("No ICU on selected SENT pin");
111 continue;
112 }
113
115
116 icuStart(icu, cfg);
117 icuStartCapture(icu);
118 icuEnableNotifications(icu);
119 }
120}
void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
static constexpr engine_configuration_s * engineConfiguration
uint32_t iomode_t
Digital I/O modes.
bool getIcuParams(brain_pin_e hwPin, iomode_t *af_ptr, ICUDriver **icu_ptr, icuchannel_t *channel_ptr, uint32_t *clock_ptr)
bool isBrainPinValid(brain_pin_e brainPin)
Referenced by applyNewHardwareSettings(), and initSent().
◆ stopSent()
Definition at line 122 of file sent_hw_icu.cpp.
122 {
123 for (int i = 0; i < SENT_INPUT_COUNT; i++) {
125
127 continue;
128 }
129
130 ICUDriver *icu;
131
132 if (
getIcuParams(sentPin, NULL, &icu, NULL, NULL) !=
true) {
133
134
135 continue;
136 }
137
138 icuDisableNotifications(icu);
139 icuStopCapture(icu);
140 icuStop(icu);
141
143 }
144}
engine_configuration_s & activeConfiguration
void efiSetPadUnused(brain_pin_e brainPin)
Referenced by applyNewHardwareSettings().
◆ icucfg
| ICUConfig icucfg[SENT_INPUT_COUNT] |
|
static |
Initial value:=
{
{
.mode = ICU_INPUT_ACTIVE_LOW,
.frequency = SENT_ICU_FREQ,
.width_cb = NULL,
.overflow_cb = NULL,
.channel = ICU_CHANNEL_1,
.dier = 0U,
.arr = 0xFFFFFFFFU,
}
}
static void icuovercapture_in1(ICUDriver *icup)
static void icuperiodcb_in1(ICUDriver *icup)
Definition at line 80 of file sent_hw_icu.cpp.
81{
82 {
83 .mode = ICU_INPUT_ACTIVE_LOW,
84 .frequency = SENT_ICU_FREQ,
85 .width_cb = NULL,
87 .overflow_cb = NULL,
88 .channel = ICU_CHANNEL_1,
89 .dier = 0U,
90 .arr = 0xFFFFFFFFU,
92 }
93};
Referenced by icuperiodcb(), and startSent().
◆ lastPulse
| uint16_t lastPulse[SENT_INPUT_COUNT] |
|
static |
◆ overcapture
| bool overcapture[SENT_INPUT_COUNT] |
|
static |
Go to the source code of this file.