Skip to content

Commit 5694a78

Browse files
Merge #485
485: Add CORDIC math function accelerator support to stm32g4 r=adamgreig a=pawelchcki Add CORDIC math accellerator enum definitions to stm32g4 family - modified description on mislabeled registiers - added clarifying descriptions for two CORDICs CSR fields Co-authored-by: Pawel Chojnacki <pawelchcki@gmail.com> Co-authored-by: Pawel Chojnacki <pawel.chcki@gmail.com>
2 parents d6dfa47 + d1ac040 commit 5694a78

File tree

9 files changed

+75
-4
lines changed

9 files changed

+75
-4
lines changed

devices/common_patches/g4_cordic.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORDIC:
2+
CSR:
3+
_modify:
4+
PRECISION:
5+
description: Precision (number of iterations/cycles) required
6+
SCALE:
7+
description: Scaling factor (2^-n for arguments, 2^n for results)
8+
_modify:
9+
WDATA:
10+
description: "CORDIC argument register"
11+
RDATA:
12+
description: "CORDIC result register"

devices/stm32g431.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ _include:
1313
- ./common_patches/g4_swap_IWDG_WWDG.yaml
1414
- ../peripherals/iwdg/iwdg_with_WINR.yaml
1515
- ../peripherals/wwdg/g4_wwdg.yaml
16+
- ./common_patches/g4_cordic.yaml
17+
- ../peripherals/cordic/cordic_g4.yaml

devices/stm32g441.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ _include:
1313
- ./common_patches/g4_swap_IWDG_WWDG.yaml
1414
- ../peripherals/iwdg/iwdg_with_WINR.yaml
1515
- ../peripherals/wwdg/g4_wwdg.yaml
16+
- ./common_patches/g4_cordic.yaml
17+
- ../peripherals/cordic/cordic_g4.yaml
1618

devices/stm32g471.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ _include:
1313
- ./common_patches/g4_swap_IWDG_WWDG.yaml
1414
- ../peripherals/iwdg/iwdg_with_WINR.yaml
1515
- ../peripherals/wwdg/g4_wwdg.yaml
16-
16+
- ./common_patches/g4_cordic.yaml
17+
- ../peripherals/cordic/cordic_g4.yaml
18+

devices/stm32g473.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ _include:
1313
- ./common_patches/g4_swap_IWDG_WWDG.yaml
1414
- ../peripherals/iwdg/iwdg_with_WINR.yaml
1515
- ../peripherals/wwdg/g4_wwdg.yaml
16-
16+
- ./common_patches/g4_cordic.yaml
17+
- ../peripherals/cordic/cordic_g4.yaml

devices/stm32g474.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ _include:
1313
- ./common_patches/g4_swap_IWDG_WWDG.yaml
1414
- ../peripherals/iwdg/iwdg_with_WINR.yaml
1515
- ../peripherals/wwdg/g4_wwdg.yaml
16+
- ./common_patches/g4_cordic.yaml
17+
- ../peripherals/cordic/cordic_g4.yaml
1618

devices/stm32g483.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ _include:
1313
- ./common_patches/g4_swap_IWDG_WWDG.yaml
1414
- ../peripherals/iwdg/iwdg_with_WINR.yaml
1515
- ../peripherals/wwdg/g4_wwdg.yaml
16-
16+
- ./common_patches/g4_cordic.yaml
17+
- ../peripherals/cordic/cordic_g4.yaml

devices/stm32g484.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ _include:
1313
- ./common_patches/g4_swap_IWDG_WWDG.yaml
1414
- ../peripherals/iwdg/iwdg_with_WINR.yaml
1515
- ../peripherals/wwdg/g4_wwdg.yaml
16-
16+
- ./common_patches/g4_cordic.yaml
17+
- ../peripherals/cordic/cordic_g4.yaml

peripherals/cordic/cordic_g4.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# CORDIC coprocessor provides hardware acceleration
2+
# for computing math funcitons
3+
4+
CORDIC:
5+
CSR:
6+
RRDY:
7+
_read:
8+
NotReady: [0, "Results from computation are not read"]
9+
Ready: [1, "Results are ready, this flag will be automatically cleared once value is read"]
10+
ARGSIZE:
11+
Bits32: [0, "Use 32 bit input values"]
12+
Bits16: [1, "Use 16 bit input values"]
13+
RESSIZE:
14+
Bits32: [0, "Use 32 bit output values"]
15+
Bits16: [1, "Use 16 bit output values"]
16+
NARGS:
17+
Num1: [0, "Only single argument write is needed for next calculation"]
18+
Num2: [1, "Two argument writes need to be performed for next calculation"]
19+
NRES:
20+
Num1: [0, "Only single result value will be returned. After a single read RRDY will be automatically cleared"]
21+
Num2: [1, "Two return reads need to be performed. After two reads RRDY will be automatically cleared"]
22+
DMAWEN:
23+
Disabled: [0, "No DMA channel writes are generated"]
24+
Enabled: [1, "Write requests are generated on the DMA channel when no operation is pending"]
25+
DMAREN:
26+
Disabled: [0, "No DMA channel reads are generated"]
27+
Enabled: [1, "Read requests are generated on the DMA channel when RRDY flag is set"]
28+
IEN:
29+
Disabled: [0, "Disable interrupt request generation"]
30+
Enabled: [1, "Enable intterrupt request generation"]
31+
PRECISION: [1, 15]
32+
SCALE: [0, 7]
33+
FUNC:
34+
Cosine: [0, "Cosine funciton"]
35+
Sine: [1, "Sine function"]
36+
Phase: [2, "Phase function"]
37+
Modulus: [3, "Modulus function"]
38+
Arctangent: [4, "Arctangent function"]
39+
HyperbolicCosine: [5, "Hyperbolic Cosine function"]
40+
HyperbolicSine: [6, "Hyperbolic Sine function"]
41+
Arctanh: [7, "Arctanh function"]
42+
NaturalLogarithm: [8, "Natural Logarithm function"]
43+
SquareRoot: [9, "Square Root function"]
44+
WDATA:
45+
ARG: [0, 0xFFFFFFFF]
46+
47+
RDATA:
48+
RES: [0, 0xFFFFFFFF]

0 commit comments

Comments
 (0)