-
Notifications
You must be signed in to change notification settings - Fork 0
DFSDM #614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
DFSDM #614
Changes from all commits
90ca98e
8732116
3445aa2
4f13110
fd1b967
894d60e
e8216f7
5cc4af8
27f2b93
71661b1
7b07dcd
342c9a9
6c67c0c
12d51ca
691b396
0cb2cbe
412e133
22ab26d
0e0235b
fbfc0d6
574abd8
63cb9e8
457a791
dfd5340
2dfdf38
3a12e39
47efb88
9cfa240
10688b5
b5846fd
cc4e9bc
24738ff
5cbb065
21bc1b8
1466802
c088c60
683b056
12a4c0f
0e3d73b
8683e31
9df3168
18705ce
2ed7947
80be128
c06bd0f
7af2239
969f5d9
7fc4709
50cff63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| release: minor | ||
| summary: Added module dfsdm tested |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -136,6 +136,32 @@ TimerXList | |||||||||
| Basic_6 = 6, | ||||||||||
| Basic_7 = 7, | ||||||||||
| }; | ||||||||||
| enum class SelectionTrigger1 : uint32_t { | ||||||||||
| Reset = TIM_TRGO_RESET, | ||||||||||
| Enable = TIM_TRGO_ENABLE, | ||||||||||
| Update = TIM_TRGO_UPDATE, | ||||||||||
| General_Compare = TIM_TRGO_OC1, | ||||||||||
| Compare_channel1 = TIM_TRGO_OC1REF, | ||||||||||
| Compare_channel2 = TIM_TRGO_OC2REF, | ||||||||||
| Compare_channel3 = TIM_TRGO_OC3REF, | ||||||||||
| Compare_channel4 = TIM_TRGO_OC4REF | ||||||||||
| }; | ||||||||||
| enum class SelectionTrigger2 : uint32_t { | ||||||||||
| Reset = TIM_TRGO2_RESET, | ||||||||||
| Enable = TIM_TRGO2_ENABLE, | ||||||||||
| Update = TIM_TRGO2_UPDATE, | ||||||||||
| General_Compare = TIM_TRGO2_OC1, | ||||||||||
| Compare_channel1 = TIM_TRGO2_OC1REF, | ||||||||||
| Compare_channel2 = TIM_TRGO2_OC2REF, | ||||||||||
| Compare_channel3 = TIM_TRGO2_OC3REF, | ||||||||||
| Compare_channel4 = TIM_TRGO2_OC4REF, | ||||||||||
| Compare_channel5 = TIM_TRGO2_OC5REF, | ||||||||||
| Compare_channel6 = TIM_TRGO2_OC6REF, | ||||||||||
| Compare_channel4_R_channel6_F = TIM_TRGO2_OC4REF_RISING_OC6REF_FALLING, | ||||||||||
| Compare_channel4_R_channel6_R = TIM_TRGO2_OC4REF_RISING_OC6REF_RISING, | ||||||||||
| Compare_channel5_R_channel6_F = TIM_TRGO2_OC5REF_RISING_OC6REF_FALLING, | ||||||||||
| Compare_channel5_R_channel6_R = TIM_TRGO2_OC5REF_RISING_OC6REF_RISING | ||||||||||
| }; | ||||||||||
|
|
||||||||||
| // Alternate functions for timers | ||||||||||
| enum class TimerAF { | ||||||||||
|
|
@@ -231,10 +257,14 @@ TimerXList | |||||||||
| TimerRequest request; | ||||||||||
| uint8_t pin_count; | ||||||||||
| std::array<TimerPin, 7> pins; /* this won't be read in Timer constructor */ | ||||||||||
| SelectionTrigger1 trgo1{SelectionTrigger1::Reset}; | ||||||||||
| SelectionTrigger2 trgo2{SelectionTrigger2::Reset}; | ||||||||||
| }; | ||||||||||
|
|
||||||||||
| struct Config { | ||||||||||
| uint8_t timer_idx; | ||||||||||
| SelectionTrigger1 trgo1; | ||||||||||
| SelectionTrigger2 trgo2; | ||||||||||
| }; | ||||||||||
|
|
||||||||||
| static constexpr TIM_HandleTypeDef* hal_handles[16] = {// general purpose timers | ||||||||||
|
|
@@ -468,15 +498,17 @@ TimerXList | |||||||||
| : e(ent.name, | ||||||||||
| ent.request, | ||||||||||
| sizeof...(pinargs), | ||||||||||
| std::array<TimerPin, 7>( | ||||||||||
| {GetPinFromIdx(pinargs, 0), | ||||||||||
| GetPinFromIdx(pinargs, 1), | ||||||||||
| GetPinFromIdx(pinargs, 2), | ||||||||||
| GetPinFromIdx(pinargs, 3), | ||||||||||
| GetPinFromIdx(pinargs, 4), | ||||||||||
| GetPinFromIdx(pinargs, 5), | ||||||||||
| GetPinFromIdx(pinargs, 6)} | ||||||||||
| )), | ||||||||||
| std::array<TimerPin, 7>({ | ||||||||||
| GetPinFromIdx(pinargs, 0), | ||||||||||
| GetPinFromIdx(pinargs, 1), | ||||||||||
| GetPinFromIdx(pinargs, 2), | ||||||||||
| GetPinFromIdx(pinargs, 3), | ||||||||||
| GetPinFromIdx(pinargs, 4), | ||||||||||
| GetPinFromIdx(pinargs, 5), | ||||||||||
| GetPinFromIdx(pinargs, 6), | ||||||||||
| }), | ||||||||||
| ent.trgo1, | ||||||||||
| ent.trgo2), | ||||||||||
| gpio0(GetGPIOFromIdx(pinargs, ent.request, 0)), | ||||||||||
| gpio1(GetGPIOFromIdx(pinargs, ent.request, 1)), | ||||||||||
| gpio2(GetGPIOFromIdx(pinargs, ent.request, 2)), | ||||||||||
|
|
@@ -521,6 +553,8 @@ TimerXList | |||||||||
| .request = e.request, | ||||||||||
| .pin_count = e.pin_count, | ||||||||||
| .pins = e.pins, | ||||||||||
| .trgo1 = e.trgo1, | ||||||||||
| .trgo2 = e.trgo2 | ||||||||||
| }; | ||||||||||
| ctx.template add<TimerDomain>(local_entry, this); | ||||||||||
| } | ||||||||||
|
|
@@ -575,6 +609,8 @@ TimerXList | |||||||||
|
|
||||||||||
| Config cfg = { | ||||||||||
| .timer_idx = timer_idxmap[reqint], | ||||||||||
| .trgo1 = requests[i].trgo1, | ||||||||||
| .trgo2 = requests[i].trgo2 | ||||||||||
| }; | ||||||||||
| cfgs[cfg_idx++] = cfg; | ||||||||||
|
|
||||||||||
|
|
@@ -607,6 +643,8 @@ TimerXList | |||||||||
| uint8_t reqint = remaining_32bit_timers[count_32bit_requests]; | ||||||||||
| Config cfg = { | ||||||||||
| .timer_idx = timer_idxmap[reqint], | ||||||||||
| .trgo1 = requests[i].trgo1, | ||||||||||
| .trgo2 = requests[i].trgo2 | ||||||||||
| }; | ||||||||||
| cfgs[cfg_idx++] = cfg; | ||||||||||
|
|
||||||||||
|
|
@@ -656,6 +694,8 @@ TimerXList | |||||||||
| uint8_t reqint = remaining_timers[i]; | ||||||||||
| Config cfg = { | ||||||||||
| .timer_idx = timer_idxmap[reqint], | ||||||||||
| .trgo1 = requests[i].trgo1, | ||||||||||
| .trgo2 = requests[i].trgo2 | ||||||||||
|
Comment on lines
+697
to
+698
|
||||||||||
| .trgo1 = requests[i].trgo1, | |
| .trgo2 = requests[i].trgo2 | |
| .trgo1 = e.trgo1, | |
| .trgo2 = e.trgo2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In TimerDomain::build(), when allocating Any32bit requests you compute
const Entry& e = requests[remaining_requests[i]]but the config copiestrgo1/trgo2fromrequests[i]instead ofe. This will misconfigure triggers wheneverremaining_requests[i] != i; use the selected entry (e.trgo1/e.trgo2).